Skip to content

Instantly share code, notes, and snippets.

@trilliwon
Created December 16, 2019 02:40
Show Gist options
  • Save trilliwon/53bbf8d6080e4c38e3ffa4dddab2e243 to your computer and use it in GitHub Desktop.
Save trilliwon/53bbf8d6080e4c38e3ffa4dddab2e243 to your computer and use it in GitHub Desktop.
import Foundation
import os.log
extension OSLog {
static var appDefault: OSLog {
return log(category: "app_default")
}
private static func log(category: String) -> OSLog {
let bundleId = Bundle.main.bundleIdentifier ?? ""
return OSLog(subsystem: bundleId, category: category)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment