StandardLogFormatter
open class StandardLogFormatter: FieldBasedLogFormatter
A standard LogFormatter that provides some common customization points.
-
Initializes a new
StandardLogFormatterinstance.Declaration
Swift
public init(timestampStyle: TimestampStyle? = .default, severityStyle: SeverityStyle? = .simple, delimiterStyle: DelimiterStyle? = nil, showCallSite: Bool = true, showCallingThread: Bool = false)Parameters
timestampStyleGoverns the formatting of the timestamp in the log output. Pass
nilto suppress output of the timestamp.severityStyleGoverns the formatting of the
LogSeverityin the log output. Passnilto suppress output of the severity.delimiterStyleIf provided, overrides the default field separator delimiters. Pass
nilto use the default delimiters.showCallSiteIf
true, the source file and line indicating the call site of the log request will be added to formatted log messages.showCallingThreadIf
true, a hexadecimal string containing an opaque identifier for the calling thread will be added to formatted log messages.
View on GitHub
StandardLogFormatter Class Reference