LogFormat
public struct LogFormat
Specifies the format to be used in the log message
-
The template string that contains how the log message should be formatted
Declaration
Swift
public let template: String -
The attributes to be used in the log message
Declaration
Swift
public let attributes: [LogFormatter.Attributes]? -
Initialises an instance of LogFormat - Parameter template: The template string that contains how the log message should be formatted - Parameter attributes: The attributes to be used in the log message
Declaration
Swift
public init(template: String, attributes: [LogFormatter.Attributes]?)Parameters
templateThe template string that contains how the log message should be formatted
attributesThe attributes to be used in the log message
-
The default log format Logs will appear in the following format, in accordance with the specified template:
i.e. [FATAL 16:12:24 ViewController.swift:21] ["TIFU by force unwrapping a nil optional"]Declaration
Swift
public static var defaultLogFormat = LogFormat(template: "[%@ %@ %@:%@] %@", attributes: [
View on GitHub
LogFormat Struct Reference