BasicLogConfiguration
open class BasicLogConfiguration: LogConfiguration
In case the name didn’t give it away, the BasicLogConfiguration class
provides a basic implementation of the LogConfiguration protocol.
-
The minimum
LogSeveritysupported by the configuration.Declaration
Swift
open let minimumSeverity: LogSeverity -
The
LogFilters to use when deciding whether a givenLogEntryshould be passed along to the receiver’srecorders. If any filter returnsfalsefromshouldRecordLogEntry(_:), theLogEntrywill be silently ignored when being processed for thisLogConfiguration.Declaration
Swift
open let filters: [LogFilter] -
The
LogRecorders to use for recording anyLogEntrythat has passed the filtering process.Declaration
Swift
open let recorders: [LogRecorder] -
A flag indicating whether synchronous mode will be used when passing
LogEntryinstances to the receiver’srecorders. 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
open let synchronousMode: Bool -
For organizational purposes, a given
LogConfigurationmay in turn contain one or more additionalLogConfigurations. Each containedLogConfigurationis an entirely separate entity; children do not inherit any state from parent containers.Declaration
Swift
open let configurations: [LogConfiguration]? -
Initializes a new
BasicLogConfigurationinstance.Declaration
Swift
public init(minimumSeverity: LogSeverity = .info, filters: [LogFilter] = [], recorders: [LogRecorder] = [], synchronousMode: Bool = false, configurations: [LogConfiguration]? = nil)Parameters
minimumSeverityThe minimum
LogSeveritysupported by the configuration. Log entries having aseverityless thanminimumSeveritywill not be passed to the receiver’srecorders.filtersThe
LogFilters to use when deciding whether a givenLogEntryshould be passed along to the receiver’sLogRecorders.recordersThe
LogRecorders to use for recording anyLogEntrythat has passed the filtering process.synchronousModeDetermines whether synchronous mode will be used when passing
LogEntryinstances to the receiver’srecorders. 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.configurationsOptional
LogConfigurations. For organizational purposes, a givenLogConfigurationmay in turn contain one or more additionalLogConfigurations. Note that these are handled as entirely separate entities; the receiver’s state does not affect the behavior of the contained configurations in any way.
View on GitHub
BasicLogConfiguration Class Reference