Skip to content

Instantly share code, notes, and snippets.

@seanho
Created August 4, 2017 12:12
Show Gist options
  • Save seanho/a57dd68395dec7018bcec87d6338cf62 to your computer and use it in GitHub Desktop.
Save seanho/a57dd68395dec7018bcec87d6338cf62 to your computer and use it in GitHub Desktop.
os_log() wrapper
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