XcodeLogFormatter
open class XcodeLogFormatter: StandardLogFormatter
A LogFormatter ideal for use within Xcode.
By default, this formatter:
- Uses
.defaultas the defaultTimestampStyle - Uses
.xcodeas the defaultSeverityStyle - Uses default field separator delimiters
- Outputs the call site
- Does not output the calling thread
These defaults can be overridden by providing alternate values to the initializer.
-
Initializes a new
XcodeLogFormatterinstance.Declaration
Swift
public override init(timestampStyle: TimestampStyle? = .default, severityStyle: SeverityStyle? = .xcode, 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
XcodeLogFormatter Class Reference