From 337737765f378a1e8cfc7d3e88d45b3bab279b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sau=CC=88l=20Baro=CC=81=20Ruiz?= Date: Wed, 3 Mar 2021 16:03:02 +1100 Subject: [PATCH] Fix function being dropped on source-less trace 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 b5be302c..e76c68b3 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.