public protocol LogRecorder
LogRecorder instance is responsible recording formatted log messages
(along with their accompanying
LogEntry instances) to an underlying log
facility or data store.
LogFormatters that should be used to create a formatted log string for passing to the receiver’s
recordFormattedString()function. Formatters are consulted sequentially and given an opportunity to return a formatted string for each
LogEntry. The first non-
nilreturn value is sent to the log for recording. Typically, an implementation of this protocol would not hard-code the
LogFormatters it uses, but would instead provide a constructor that accepts an array of
LogFormatters, which it will subsequently return from this property.
var formatters: [LogFormatter]
Returns the GCD queue that will be used when executing tasks related to the receiver. Log formatting and recording will be performed using this queue. A serial queue is typically used, such as when the underlying log facility is inherently single-threaded and/or proper message ordering wouldn’t be ensured otherwise. However, a concurrent queue may also be used, and might be appropriate when logging to databases or network endpoints.
var queue: DispatchQueue
Called by the
LogReceptacleto record the formatted log message.
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.