Browse Source

Only log for debug builds.

master
Abhishek Banthia 7 months ago
parent
commit
2c91af2924
  1. 4
      Clocker/CoreLoggerKit/Sources/CoreLoggerKit/Logger.swift

4
Clocker/CoreLoggerKit/Sources/CoreLoggerKit/Logger.swift

@ -9,15 +9,19 @@ public class Logger: NSObject {
let logObjc = OSLog(subsystem: "com.abhishek.Clocker", category: "app") let logObjc = OSLog(subsystem: "com.abhishek.Clocker", category: "app")
public class func log(object annotations: [String: Any]?, for event: NSString) { public class func log(object annotations: [String: Any]?, for event: NSString) {
#if DEBUG
if #available(OSX 10.14, *) { if #available(OSX 10.14, *) {
os_log(.default, "[%@] - [%@]", event, annotations ?? [:]) os_log(.default, "[%@] - [%@]", event, annotations ?? [:])
} }
#endif
} }
public class func info(_ message: String) { public class func info(_ message: String) {
#if DEBUG
if #available(OSX 10.14, *) { if #available(OSX 10.14, *) {
os_log(.info, "%@", message) os_log(.info, "%@", message)
} }
#endif
} }
} }

Loading…
Cancel
Save