astzweig/swift-log-oslog
A unified OSLog backend implementation for SwiftLog
Installation
To use this library in your project, add it to the package dependencies:
.package(url: "https://github.com/astzweig/swift-log-oslog", from: "1.0.0")and add it as a dependency on the specific target:
.target(
name: "YourTarget",
dependencies: [
.product(name: "LoggingOSLog", package: "swift-log-oslog")
]
)Basic Usage
// Import the logging API and this backend implementation
import Logging
#if canImport(Darwin)
import LoggingOSLog
#endif
// Later, in your application initialization code
func init() {
// ...
#if canImport(Darwin)
LoggingSystem.bootstrap(LoggingOSLog.init)
#endif
// Start creating loggers
let loggers: [String: Logger] = [
"main": Logger(label: "com.example.yourapp.Main"),
"mail": Logger(label: "com.example.yourapp.Mail System"),
]
}Package Metadata
Repository: astzweig/swift-log-oslog
Stars: 1
Forks: 0
Open issues: 0
Default branch: main
Primary language: swift
License: EUPL-1.2
Topics: log-handler, swift-log, unified-logging-system
README: README.md