diff --git a/Package.resolved b/Package.resolved index 56b8a9f..832f789 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log", "state" : { - "revision" : "bbd81b6725ae874c69e9b8c8804d462356b55523", - "version" : "1.10.1" + "revision" : "5073617dac96330a486245e4c0179cb0a6fd2256", + "version" : "1.12.0" } } ], diff --git a/Sources/Logging OSLog/Logging OSLog.swift b/Sources/Logging OSLog/Logging OSLog.swift index 69aeac6..cc2e1c6 100644 --- a/Sources/Logging OSLog/Logging OSLog.swift +++ b/Sources/Logging OSLog/Logging OSLog.swift @@ -84,6 +84,13 @@ public struct LoggingOSLog: LogHandler { let message = messageParts.compactMap { $0 }.joined(separator: " → ") self.oslogger.log(level: OSLogType.from(loggerLevel: level), "\(message, privacy: .public)") } + + /** + This function is called by [SwiftLog](https://github.com/apple/swift-log). + */ + public func log(event: LogEvent) { + self.log(level: event.level, message: event.message, metadata: event.metadata, source: event.source, file: event.file, function: event.function, line: event.line) + } /** Use subscripts on struct instances, to add metadata for all future log messages.