Merge pull request #2 from Alexander-Ignition/master init with OSLog
Merge pull request #2 from Alexander-Ignition/master
init with OSLog
OSLog logging backend for swift-log.
If you’re adding through Xcode’s Swift Package Manager integration (Xcode 11 and higher), you can simply use:
https://github.com/chrisaljoudi/swift-log-oslog.git
And use 0.2.1 as the base version. If adding as a dependency in your Package.swift:
0.2.1
Package.swift
.package(url: "https://github.com/chrisaljoudi/swift-log-oslog.git", .from("0.2.1"))
During app startup/initialization:
import Logging import LoggingOSLog /// Configure `swift-log` logging system to use OSLog backend LoggingSystem.bootstrap(LoggingOSLog.init)
Then use swift-log per usual, for example:
swift-log
let logger = Logger(label: "com.yourcompany.yourawesomeapp") /// ... logger.info("Unified Logging is pretty cool.")
For more details on all the features of the Swift Logging API, check out the swift-log repo.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
LoggingOSLog
OSLog logging backend for swift-log.
Getting Started
If you’re adding through Xcode’s Swift Package Manager integration (Xcode 11 and higher), you can simply use:
And use
0.2.1
as the base version. If adding as a dependency in yourPackage.swift
:Usage
During app startup/initialization:
Then use
swift-log
per usual, for example:For more details on all the features of the Swift Logging API, check out the
swift-log
repo.