open class StandardStreamsLogRecorder: LogRecorderBase
StandardStreamsLogRecorder is a
LogRecorder that writes log messages
to either the standard output stream (
`stdout`) or the standard error stream
`stderr`) of the running process.
Messages are directed to the appropriate stream depending on the
property of the
LogEntry being recorded.
Messages having a severity of
.info will be
stdout, while those with a severity of
are directed to
StandardStreamsLogRecorderinstance to use the specified
LogFormatters for formatting log messages.
public override init(formatters: [LogFormatter], queue: DispatchQueue? = nil)
An array of
LogFormatters to use for formatting log entries that will be recorded by the receiver.
DispatchQueueto use for the recorder. If
nil, a new queue will be created.
This implementation, which does nothing, is present to satisfy the
LogRecorderprotocol. Subclasses must override this function to provide actual log recording functionality.
This function is only called if one of the
formattersassociated with the receiver returned a non-
nilstring for the given
open override func record(message: String, for entry: LogEntry, currentQueue: DispatchQueue, synchronousMode: Bool)
The message to record.
The GCD queue on which the function is being executed.
true, the recording is being done in synchronous mode, and the recorder should act accordingly.