OutputStreamLogRecorder
open class OutputStreamLogRecorder: LogRecorderBase
The OutputStreamLogRecorder logs messages by writing to the standard
output stream of the running process.
-
Initializes a
StandardOutputLogRecorderinstance to use the specifiedLogFormatterimplementation for formatting log messages.Declaration
Swift
public init(stream: UnsafeMutablePointer<FILE>, formatters: [LogFormatter], queue: DispatchQueue? = nil)Parameters
streamA standard C file handle to use as the output stream.
formattersAn array of
LogFormatters to use for formatting log entries that will be recorded by the receiver.queueThe
DispatchQueueto use for the recorder. Ifnil, a new queue will be created. -
Called to record the specified message to standard output.
Note
This function is only called if one of the
formattersassociated with the receiver returned a non-nilstring for the givenLogEntry.Declaration
Swift
open override func record(message: String, for entry: LogEntry, currentQueue: DispatchQueue, synchronousMode: Bool)Parameters
messageThe message to record.
entryThe
LogEntryfor whichmessagewas created.currentQueueThe GCD queue on which the function is being executed.
synchronousModeIf
true, the recording is being done in synchronous mode, and the recorder should act accordingly.
View on GitHub
OutputStreamLogRecorder Class Reference