BufferedMessageRecorder
open class BufferedMessageRecorder: BufferedLogRecorder<String>
The BufferedMessageRecorder buffers the formatted log messages passed to
its record() function.
-
Initializes a new
BufferedMessageRecorder.Declaration
Swift
public init(formatters: [LogFormatter], bufferLimit: Int = 10_000, queue: DispatchQueue? = nil)Parameters
formattersAn array of
LogFormatters to use for formatting log entries to be recorded by the receiver. Each formatter is consulted in sequence, and the formatted string returned by the first formatter to yield a non-nilvalue will be recorded. If every formatter returnsnil, the log entry is silently ignored and not recorded.bufferLimitIf this value is positive, it specifies the maximum number of items to store in the buffer. If
record()is called when the buffer limit has been reached, the oldest item in the buffer will be dropped. If this value is zero or negative, no limit will be applied. Note that this is potentially dangerous in production code, since memory consumption will grow endlessly unless you manually clear the buffer periodically.queueThe
DispatchQueueto use for the recorder. Ifnil, a new queue will be created.
View on GitHub
BufferedMessageRecorder Class Reference