ChimeHQ/UnifiedLoggingPlus
Micro-framework for making OSLog more pleasant
Integration
Swift Package Manager:
dependencies: [
.package(url: "https://github.com/ChimeHQ/UnifiedLoggingPlus")
]Usage
Simple helper for Logger.
let logger = Logger(category: "MyCategory") // uses OSLog(category:)More consise logging statements.
let log = OSLog(bundleIdScopedCategory: "MyCategory")!
let otherLog = OSLog(category: "MyCategory") // defaults to using bundle-id for scoping
log.debug("A")
log.info("B: %{public}@", value)
do {
try thingThatThrows()
} catch {
log.error("print error type without conversion: %{public}@", error)
}
Signpost is a simple type that encapsulates os_signpost calls, and a bunch of simple extension on OSLog.
let log = OSLog(bundleIdScopedCategory: "MyCategory")!
log.debug("concise log statements")
let result = log.signpostWithin("name") {
// this gets measured by the signpost
}Suggestions or Feedback
We'd love to hear from you! Get in touch via an issue or pull request.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
[build status]: https://github.com/ChimeHQ/UnifiedLoggingPlus/actions [build status badge]: https://github.com/ChimeHQ/UnifiedLoggingPlus/workflows/CI/badge.svg [license]: https://opensource.org/licenses/BSD-3-Clause [license badge]: https://img.shields.io/github/license/ChimeHQ/UnifiedLoggingPlus [platforms]: https://swiftpackageindex.com/ChimeHQ/UnifiedLoggingPlus [platforms badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FChimeHQ%2FUnifiedLoggingPlus%2Fbadge%3Ftype%3Dplatforms
Package Metadata
Repository: ChimeHQ/UnifiedLoggingPlus
Stars: 10
Forks: 1
Open issues: 0
Default branch: main
Primary language: swift
License: BSD-3-Clause
Topics: logging, swift
README: README.md
Archived: yes