Skip to content

Instantly share code, notes, and snippets.

@smosko
smosko / OSLog+Extensions.swift
Last active December 26, 2022 07:54
Unified Logging Wrapper
import Foundation
@_exported import os.log
public extension OSLog {
convenience init(_ bundle: Bundle = .main, category: String? = nil) {
self.init(subsystem: bundle.bundleIdentifier ?? "default", category: category ?? "default")
}
convenience init(_ aClass: AnyClass, category: String? = nil) {
@foffer
foffer / Logger.swift
Created July 23, 2017 20:22
Wrapper on os.log
import os.log
struct Logger {
private let logger: OSLog
enum LogCategory:String {
case uploads
case downloads
case realm