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
LogSeverity
supported by the configuration.Declaration
Swift
open let minimumSeverity: LogSeverity
-
The
LogFilter
s to use when deciding whether a givenLogEntry
should be passed along to the receiver’srecorders
. If any filter returnsfalse
fromshouldRecordLogEntry(_:)
, theLogEntry
will be silently ignored when being processed for thisLogConfiguration
.Declaration
Swift
open let filters: [LogFilter]
-
The
LogRecorder
s to use for recording anyLogEntry
that has passed the filtering process.Declaration
Swift
open let recorders: [LogRecorder]
-
A flag indicating whether synchronous mode will be used when passing
LogEntry
instances 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
LogConfiguration
may in turn contain one or more additionalLogConfiguration
s. Each containedLogConfiguration
is an entirely separate entity; children do not inherit any state from parent containers.Declaration
Swift
open let configurations: [LogConfiguration]?
-
Initializes a new
BasicLogConfiguration
instance.Declaration
Swift
public init(minimumSeverity: LogSeverity = .info, filters: [LogFilter] = [], recorders: [LogRecorder] = [], synchronousMode: Bool = false, configurations: [LogConfiguration]? = nil)
Parameters
minimumSeverity
The minimum
LogSeverity
supported by the configuration. Log entries having aseverity
less thanminimumSeverity
will not be passed to the receiver’srecorders
.filters
The
LogFilter
s to use when deciding whether a givenLogEntry
should be passed along to the receiver’sLogRecorder
s.recorders
The
LogRecorder
s to use for recording anyLogEntry
that has passed the filtering process.synchronousMode
Determines whether synchronous mode will be used when passing
LogEntry
instances 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.configurations
Optional
LogConfiguration
s. For organizational purposes, a givenLogConfiguration
may in turn contain one or more additionalLogConfiguration
s. 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.