XcodeLogConfiguration
open class XcodeLogConfiguration: BasicLogConfiguration
A LogConfiguration
optimized for use when running within Xcode.
The XcodeLogConfiguration
sets up a single recorder: an ASLLogRecorder
configured to echo output to stdout
as well as capturing to the ASL.
-
init(minimumSeverity:debugMode:verboseDebugMode:logToASL:timestampStyle:severityStyle:showCallSite:showCallingThread:showSeverity:filters:)
Initializes a new
XcodeLogConfiguration
instance.Warning
Setting either
debugMode
orverboseDebugMode
totrue
will result insynchronousMode
being used when recording log entries. Synchronous mode is helpful while debugging, as it ensures that logs are always up-to-date when debug breakpoints are hit. However, synchronous mode can have a negative influence on performance and is therefore not recommended for use in production code.Declaration
Swift
public convenience init(minimumSeverity: LogSeverity = .info, debugMode: Bool = false, verboseDebugMode: Bool = false, logToASL: Bool = true, timestampStyle: TimestampStyle? = .default, severityStyle: SeverityStyle? = .xcode, showCallSite: Bool = true, showCallingThread: Bool = false, showSeverity: Bool = true, filters: [LogFilter] = [])
Parameters
minimumSeverity
The minimum supported
LogSeverity
. AnyLogEntry
having aseverity
less thanminimumSeverity
will be silently ignored.debugMode
If
true
, the value ofminimumSeverity
will be lowered (if necessary) to.debug
andsynchronousMode
will be used when recording log entries.verboseDebugMode
If
true
, the value ofminimumSeverity
will be lowered (if necessary) to.verbose
andsynchronousMode
will be used when recording log entries.logToASL
If
true
, messages sent to the Xcode console will also be sent to the Apple System Log (ASL) facility.timestampStyle
Governs the formatting of the timestamp in the log output. Pass
nil
to suppress output of the timestamp.severityStyle
Governs the formatting of the
LogSeverity
in the log output. Passnil
to suppress output of the severity.showCallSite
If
true
, the source file and line indicating the call site of the log request will be added to formatted log messages.showCallingThread
If
true
, a hexadecimal string containing an opaque identifier for the calling thread will be added to formatted log messages.filters
The
LogFilter
s to use when deciding whether a givenLogEntry
should be passed along for recording. -
Initializes a new
XcodeLogConfiguration
instance.Warning
Setting either
debugMode
orverboseDebugMode
totrue
will result insynchronousMode
being used when recording log entries. Synchronous mode is helpful while debugging, as it ensures that logs are always up-to-date when debug breakpoints are hit. However, synchronous mode can have a negative influence on performance and is therefore not recommended for use in production code.Declaration
Swift
public convenience init(minimumSeverity: LogSeverity = .info, debugMode: Bool = false, verboseDebugMode: Bool = false, logToASL: Bool = true, filters: [LogFilter] = [], formatter: LogFormatter)
Parameters
minimumSeverity
The minimum supported
LogSeverity
. AnyLogEntry
having aseverity
less thanminimumSeverity
will be silently ignored.debugMode
If
true
, the value ofminimumSeverity
will be lowered (if necessary) to.debug
andsynchronousMode
will be used when recording log entries.verboseDebugMode
If
true
, the value ofminimumSeverity
will be lowered (if necessary) to.verbose
andsynchronousMode
will be used when recording log entries.logToASL
If
true
, messages sent to the Xcode console will also be sent to the Apple System Log (ASL) facility.filters
The
LogFilter
s to use when deciding whether a givenLogEntry
should be passed along for recording.formatter
A
LogFormatter
to use for formatting log entries to be recorded. -
Initializes a new
XcodeLogConfiguration
instance.Warning
Setting either
debugMode
orverboseDebugMode
totrue
will result insynchronousMode
being used when recording log entries. Synchronous mode is helpful while debugging, as it ensures that logs are always up-to-date when debug breakpoints are hit. However, synchronous mode can have a negative influence on performance and is therefore not recommended for use in production code.Declaration
Swift
public init(minimumSeverity: LogSeverity = .info, debugMode: Bool = false, verboseDebugMode: Bool = false, logToASL: Bool = true, filters: [LogFilter] = [], formatters: [LogFormatter])
Parameters
minimumSeverity
The minimum supported
LogSeverity
. AnyLogEntry
having aseverity
less thanminimumSeverity
will be silently ignored.debugMode
If
true
, the value ofminimumSeverity
will be lowered (if necessary) to.debug
andsynchronousMode
will be used when recording log entries.verboseDebugMode
If
true
, the value ofminimumSeverity
will be lowered (if necessary) to.verbose
andsynchronousMode
will be used when recording log entries.logToASL
If
true
, messages sent to the Xcode console will also be sent to the Apple System Log (ASL) facility.filters
The
LogFilter
s to use when deciding whether a givenLogEntry
should be passed along for recording.formatters
An array of
LogFormatter
s to use for formatting log entries to be recorded.