summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN/Logging/ChainedError+Logger.swift29
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
+ )
}
-
}