File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import Foundation
10
10
11
+ // EXAMPLE OF A LOGGING FUNCTION
12
+ // func notificationLog(_ message: String) {
13
+ // // install via Tracery.logTarget = notificationLog
14
+ // NotificationCenter.default.post(name: Notification.Name("Tracery.log"), object: nil, userInfo: ["message":message])
15
+ // }
16
+
11
17
12
18
extension Tracery {
13
19
@@ -26,15 +32,10 @@ extension Tracery {
26
32
// standard logger to standard output
27
33
print ( message)
28
34
}
29
-
30
- fileprivate static func notificationLog( _ message: String ) {
31
- // install via setting logTarget to this function instead of the above
32
- NotificationCenter . default. post ( name: Notification . Name ( " Tracery.log " ) , object: nil , userInfo: [ " message " : message] )
33
- }
34
-
35
- static func log( level: LoggingLevel , message: @autoclosure ( ) -> String ) {
35
+
36
+ public static func log( level: LoggingLevel , message: @autoclosure ( ) -> String ) {
36
37
guard logLevel. rawValue >= level. rawValue else { return }
37
- stdLog ( message ( ) )
38
+ logTarget ( message ( ) )
38
39
}
39
40
40
41
func trace( _ message: @autoclosure ( ) -> String ) {
You can’t perform that action at this time.
0 commit comments