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, callingThreadStyle: CallingThreadStyle? = .hex, showCallSite: Bool = true)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.callingThreadStyleIf provided, specifies a
CallingThreadStyleto use for representing the calling thread. Ifnil, the calling thread is not shown.showCallSiteIf
true, the source file and line indicating the call site of the log request will be added to formatted log messages.
View on GitHub
StandardLogFormatter Class Reference