updated for swift-log 1.12.0

This commit is contained in:
FelixSFD
2026-04-28 19:20:29 +02:00
parent e18692fd4d
commit b4848737d2
2 changed files with 9 additions and 2 deletions

View File

@@ -6,8 +6,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log", "location" : "https://github.com/apple/swift-log",
"state" : { "state" : {
"revision" : "bbd81b6725ae874c69e9b8c8804d462356b55523", "revision" : "5073617dac96330a486245e4c0179cb0a6fd2256",
"version" : "1.10.1" "version" : "1.12.0"
} }
} }
], ],

View File

@@ -85,6 +85,13 @@ public struct LoggingOSLog: LogHandler {
self.oslogger.log(level: OSLogType.from(loggerLevel: level), "\(message, privacy: .public)") 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. Use subscripts on struct instances, to add metadata for all future log messages.
*/ */