Created
August 4, 2017 12:12
-
-
Save seanho/a57dd68395dec7018bcec87d6338cf62 to your computer and use it in GitHub Desktop.
os_log() wrapper
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 os.log | |
import Foundation | |
public struct Log { | |
static let log = OSLog(subsystem: "domain", category: "App") | |
static public func debug(_ message: Any) { | |
os_log("⚪️ DEBUG - %@", log: log, type: .debug, "\(message)") | |
} | |
static public func info(_ message: Any) { | |
os_log("🔵 INFO - %@", log: log, type: .info, "\(message)") | |
} | |
static public func error(_ message: Any) { | |
os_log("🔴 ERROR - %@", log: log, type: .error, "\(message)") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment