T. R. Bernstein e18692fd4d Separate metadata by a unicode arrow in log
Use a single unicode right arrow instead of the two char ASCII right
arrow to separate the metadata from the actual log message. This is just
a preference decision and has no functional background.
2026-03-02 19:38:45 +01:00
2026-02-28 00:21:11 +01:00
2026-03-02 16:06:21 +01:00
2026-02-28 01:16:57 +01:00
2026-02-28 01:12:28 +01:00
2026-02-28 00:21:11 +01:00
2026-02-28 00:22:08 +01:00

SwiftLog OSLog

A OSLog ([unified logging][unfied-logging]) backend implementation for SwiftLog (swift-log). It maps the label parameter of [SwiftLog (swift-log) to the subsystem and category parameter of OSLog. It even allows the use of the bundle identifier - if any as a value for the subsystem parameter.

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"),
	]
}
Description
A unified OSLog backend implementation for SwiftLog
Readme EUPL-1.2 60 KiB
Languages
Swift 100%