Last active
July 26, 2018 12:52
-
-
Save bill350/3bd2e3e94ad0f5c17c121135ed53d79d to your computer and use it in GitHub Desktop.
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
func createOSLog(context: Any?) -> OSLog { | |
var currentContext = "Default" | |
if let loggerContext = context as? String { | |
currentContext = loggerContext | |
} | |
let subsystem = Bundle.main.bundleIdentifier ?? "com.logger.default" | |
let customLog = OSLog(subsystem: subsystem, category: currentContext) | |
return customLog | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment