From 5d66f7ba25daf4f94100e7022febf3c75e37a6c7 Mon Sep 17 00:00:00 2001 From: Saul Baro Ruiz Date: Wed, 3 Mar 2021 16:35:32 +1100 Subject: [PATCH] Fix function being dropped on source-less trace (#185) Motivation: When using the recently re-introduced source-less version of trace, the function parameter that reaches the underlying LogHandler is wrong. Modifications: Pass the function parameter to trace with source parameter. Result: With these changes, the function parameter that reaches the underlying LogHandler has the correct value. --- Sources/Logging/Logging.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Logging/Logging.swift b/Sources/Logging/Logging.swift index b5be302..e76c68b 100644 --- a/Sources/Logging/Logging.swift +++ b/Sources/Logging/Logging.swift @@ -176,7 +176,7 @@ extension Logger { public func trace(_ message: @autoclosure () -> Logger.Message, metadata: @autoclosure () -> Logger.Metadata? = nil, file: String = #file, function: String = #function, line: UInt = #line) { - self.trace(message(), metadata: metadata(), source: nil, file: file, line: line) + self.trace(message(), metadata: metadata(), source: nil, file: file, function: function, line: line) } /// Log a message passing with the `Logger.Level.debug` log level.