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
XcodeLogConfigurationinstance.Warning
Setting either
debugModeorverboseDebugModetotruewill result insynchronousModebeing 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
minimumSeverityThe minimum supported
LogSeverity. AnyLogEntryhaving aseverityless thanminimumSeveritywill be silently ignored.debugModeIf
true, the value ofminimumSeveritywill be lowered (if necessary) to.debugandsynchronousModewill be used when recording log entries.verboseDebugModeIf
true, the value ofminimumSeveritywill be lowered (if necessary) to.verboseandsynchronousModewill be used when recording log entries.logToASLIf
true, messages sent to the Xcode console will also be sent to the Apple System Log (ASL) facility.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.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.filtersThe
LogFilters to use when deciding whether a givenLogEntryshould be passed along for recording. -
Initializes a new
XcodeLogConfigurationinstance.Warning
Setting either
debugModeorverboseDebugModetotruewill result insynchronousModebeing 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
minimumSeverityThe minimum supported
LogSeverity. AnyLogEntryhaving aseverityless thanminimumSeveritywill be silently ignored.debugModeIf
true, the value ofminimumSeveritywill be lowered (if necessary) to.debugandsynchronousModewill be used when recording log entries.verboseDebugModeIf
true, the value ofminimumSeveritywill be lowered (if necessary) to.verboseandsynchronousModewill be used when recording log entries.logToASLIf
true, messages sent to the Xcode console will also be sent to the Apple System Log (ASL) facility.filtersThe
LogFilters to use when deciding whether a givenLogEntryshould be passed along for recording.formatterA
LogFormatterto use for formatting log entries to be recorded. -
Initializes a new
XcodeLogConfigurationinstance.Warning
Setting either
debugModeorverboseDebugModetotruewill result insynchronousModebeing 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
minimumSeverityThe minimum supported
LogSeverity. AnyLogEntryhaving aseverityless thanminimumSeveritywill be silently ignored.debugModeIf
true, the value ofminimumSeveritywill be lowered (if necessary) to.debugandsynchronousModewill be used when recording log entries.verboseDebugModeIf
true, the value ofminimumSeveritywill be lowered (if necessary) to.verboseandsynchronousModewill be used when recording log entries.logToASLIf
true, messages sent to the Xcode console will also be sent to the Apple System Log (ASL) facility.filtersThe
LogFilters to use when deciding whether a givenLogEntryshould be passed along for recording.formattersAn array of
LogFormatters to use for formatting log entries to be recorded.
View on GitHub
XcodeLogConfiguration Class Reference