Skip to content

Commit 0dde0b2

Browse files
committed
Merge all the source metadata in a single “origin” metadata
1 parent 0499449 commit 0dde0b2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Sources/OSLogLogger.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ public struct OSLogLogger : LogHandler {
7777
public func log(level: Logging.Logger.Level, message: Logging.Logger.Message, metadata logMetadata: Logging.Logger.Metadata?, source: String, file: String, function: String, line: UInt) {
7878
/* AFAICT os.Logger does not allow passing an “original log source” when logging, so we pass the log source in the metadata… */
7979
let logMetadata = (logMetadata ?? [:]).merging([
80-
Self.pubMetaPrefix + "__source": "\(source)",
81-
Self.pubMetaPrefix + "__fileID": "\(file)",
82-
Self.pubMetaPrefix + "__function": "\(function)",
83-
Self.pubMetaPrefix + "__line": "\(line)",
80+
Self.pubMetaPrefix + "__origin": "\(source):\(file):\(line) \(function)",
8481
], uniquingKeysWith: { current, _ in current })
8582

8683
let effectiveFlatMetadata: (public: [String], private: [String])

0 commit comments

Comments
 (0)