Skip to content

Commit 13ca1f6

Browse files
committed
Merge branch 'develop'
2 parents 1f71349 + 64bff3f commit 13ca1f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+9757
-345
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
- develop
8-
- /^hotfix.*$/
9-
- /^feature.*$/
3+
on: [push]
104

115
jobs:
126
tests:
@@ -22,4 +16,4 @@ jobs:
2216
steps:
2317
- uses: actions/checkout@v1
2418
- name: fastlane ios compatibilityTests
25-
run: fastlane ios compatibilityTests
19+
run: fastlane ios compatibilityTests

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Icon
2929
._*
3030

3131
# Documentation
32-
Documentation
32+
#Documentation
3333

3434
# Files that might appear in the root of a volume
3535
.DocumentRevisions-V100
@@ -107,3 +107,4 @@ fastlane/test_output
107107
.bundle/**
108108
.vendor/**
109109
.swiftpm/**
110+
.vendor/**

.jazzy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ copyright: Copyright 2020 Alexander Weiß
44
author: Alexander Weiß
55
xcodebuild_arguments: [-target, LoggingKit-iOS]
66
clean: true
7-
output: ./Documentation
7+
output: ./docs

Configs/LoggingKit.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0.0</string>
20+
<string>2.0.0</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>

Configs/LoggingKitTests.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.0</string>
18+
<string>2.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Example/AppDelegate.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import UIKit
10+
import LoggingKit
1011

1112
// MARK: - AppDelegate
1213

@@ -30,12 +31,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3031
/// - Returns: The launch result
3132
func application(_ application: UIApplication,
3233
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
34+
35+
36+
LogService.register(logProviders: MyTestLogProvider())
37+
38+
3339
// Initialize UIWindow
3440
self.window = .init(frame: UIScreen.main.bounds)
3541
// Set RootViewController
3642
self.window?.rootViewController = self.rootViewController
3743
// Make Key and Visible
3844
self.window?.makeKeyAndVisible()
45+
3946
// Return positive launch
4047
return true
4148
}

Example/MyTestLogProvider.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// MyTestLogProvider.swift
3+
// Example
4+
//
5+
// Created by Alexander Weiß on 13.06.20.
6+
// Copyright © 2020 Alexander Weiß. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import LoggingKit
11+
12+
class MyTestLogProvider: LogProvider {
13+
14+
static var dateFormatter: DateFormatter = {
15+
let df = DateFormatter()
16+
df.dateFormat = "yyyy-MM-dd HH:mm:ssSSS"
17+
df.locale = Locale.current
18+
df.timeZone = TimeZone.current
19+
return df
20+
}()
21+
22+
23+
func log(_ event: LogType, _ message: @autoclosure () -> Any?, logCategory: KeyPath<LogCategories, LogCategory>, fileName: StaticString, functionName: StaticString, lineNumber: Int) {
24+
25+
guard let message = message() else {
26+
return
27+
}
28+
29+
let category = LoggingCategories[logCategory]
30+
let timeString = MyTestLogProvider.dateFormatter.string(from: Date())
31+
let fileString = "[\((String(describing: fileName) as NSString).lastPathComponent):\(lineNumber)] \(functionName)"
32+
33+
print("\(timeString) [\(event.rawValue)] - [\(category._key)] - \(fileString) > \(message)")
34+
35+
}
36+
}

Example/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0.0</string>
20+
<string>2.0.0</string>
2121
<key>CFBundleVersion</key>
2222
<string>1</string>
2323
<key>LSRequiresIPhoneOS</key>

Example/ViewController.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ class ViewController: UIViewController {
4343
self.view.backgroundColor = .white
4444

4545
// Traditional methods
46-
logger.debug("Hello Debug", logCategory: \.viewControllers)
47-
logger.info("Hello Info", logCategory: \.viewControllers)
48-
logger.fault("Hello Fault", logCategory: \.viewControllers)
49-
logger.error("Hello Error", logCategory: \.viewControllers)
46+
LogService.shared.debug("Hello Debug", logCategory: \.viewControllers)
47+
LogService.shared.verbose("Hello Verbose", logCategory: \.viewControllers)
48+
LogService.shared.info("Hello Info", logCategory: \.viewControllers)
49+
LogService.shared.warning("Hello Warning", logCategory: \.viewControllers)
50+
LogService.shared.error("Hello Error", logCategory: \.viewControllers)
51+
5052

5153
// Combine publishers
5254
sub = Result<Int, NumberError>.Publisher(5)

LoggingKit.xcodeproj/project.pbxproj

Lines changed: 95 additions & 33 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)