ClientLogger
public final class ClientLogger
A Client logger.
-
A customizable logger block. By default error messages will print to the console, but you can customize it to use own logger.
Declaration
Swift
public static var logger: (_ icon: String, _ dateTime: String, _ message: String) -> VoidParameters
icona small icon string like a tag for messages, e.g. 🦄
dateAndTimea formatted string of date and time, could be empty.
messagea message.
-
Init a client logger.
Declaration
Swift
public init(icon: String)Parameters
icona string icon.
-
Undocumented
Declaration
Swift
public func log(_ endpoint: TargetType) -
Log URL response.
Declaration
Swift
public func log(_ response: URLResponse?, data: Data?)Parameters
responsean URL response.
dataa response data.
forceToShowDataforce to always log a data.
-
Log an error.
Declaration
Swift
public static func log(_ icon: String = "", _ error: Error?, message: String? = nil, function: String = #function, line: Int = #line)Parameters
icona string icon, e.g. emoji.
erroran error.
messagean additional message (optional).
functiona callee function (auto).
linea callee line of a code in a function (auto).
-
Log a data as a pretty printed JSON string.
Declaration
Swift
public func log(_ identifier: String, _ data: Data?)Parameters
identifieran identifier.
dataa data.
-
Log a message with an identifier.
Declaration
Swift
public func log(_ identifier: String, _ message: String)Parameters
identifieran identifier.
messagea message.
-
Log a message.
Declaration
Swift
public func log(_ message: String)Parameters
messagea message.
-
Log a message.
Declaration
Swift
public static func log(_ icon: String, dateTime: String = "", _ message: String)Parameters
icona string icon, e.g. emoji.
dateTimea date time as a string.
messagea message.
View on GitHub
ClientLogger Class Reference