Last active
June 19, 2020 18:01
-
-
Save reyandrey/5387c83365159141cdaabd67af264209 to your computer and use it in GitHub Desktop.
Log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import os.log | |
public class Log<T> { | |
private let log: OSLog | |
public init(){ | |
self.log = OSLog(subsystem: Bundle.main.bundleIdentifier ?? "unknown", category: String(describing: T.self)) | |
} | |
public func debug(_ message: String) { | |
os_log("%@", log: log, type: .debug, message) | |
} | |
public func error(_ message: String) { | |
os_log("%@", log: log, type: .error, message) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment