diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2022-05-19 13:18:03 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2022-05-30 15:00:06 +0200 |
| commit | 126b958d164ad830233abf0cbacef623dff794b8 (patch) | |
| tree | 8114de033eddac9a1c98a8c1f1c2e88c8704ea95 | |
| parent | 92d7e6de058e703a6ebbb242e33d0a3a2d2dd504 (diff) | |
| download | mullvadvpn-126b958d164ad830233abf0cbacef623dff794b8.tar.xz mullvadvpn-126b958d164ad830233abf0cbacef623dff794b8.zip | |
ChainedError: reformat logger extension
| -rw-r--r-- | ios/MullvadVPN/Logging/ChainedError+Logger.swift | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/ios/MullvadVPN/Logging/ChainedError+Logger.swift b/ios/MullvadVPN/Logging/ChainedError+Logger.swift index a0f396767a..2d221c7132 100644 --- a/ios/MullvadVPN/Logging/ChainedError+Logger.swift +++ b/ios/MullvadVPN/Logging/ChainedError+Logger.swift @@ -10,15 +10,26 @@ import Foundation import Logging extension Logger { - - func error<T: ChainedError>(chainedError: T, - message: @autoclosure () -> String? = nil, - metadata: @autoclosure () -> Logger.Metadata? = nil, - source: @autoclosure () -> String? = nil, - file: String = #file, function: String = #function, line: UInt = #line) + func error<T: ChainedError>( + chainedError: T, + message: @autoclosure () -> String? = nil, + metadata: @autoclosure () -> Logger.Metadata? = nil, + source: @autoclosure () -> String? = nil, + file: String = #file, + function: String = #function, + line: UInt = #line + ) { - let s = Message(stringLiteral: chainedError.displayChain(message: message())) - log(level: .error, s, metadata: metadata(), source: source(), file: file, function: function, line: line) + log( + level: .error, + Message( + stringLiteral: chainedError.displayChain(message: message()) + ), + metadata: metadata(), + source: source(), + file: file, + function: function, + line: line + ) } - } |
