Skip to content

Commit

Permalink
Fix function being dropped on source-less trace (#185)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saulbaro committed Mar 3, 2021
1 parent c798842 commit 5d66f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Logging/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5d66f7b

Please sign in to comment.