CachingLogHandler

A log handler that simply appends all messages it receives to an internal array. This can be useful for testing, but should not be used for general runtime logging due to the need to synchronize access to the internal message cache.

Members

Functions

empty
bool empty()

Determines if no messages have been logged since the last time reset() was called.

getMessages
LogMessage[] getMessages()

Gets an immutable duplication of the list of messages this handler has handled since the last reset() call.

handle
void handle(LogMessage msg)

"Handles" a log message by appending it to this handler's internal list of messages, for later inspection.

messageCount
size_t messageCount()

Gets the number of messages that this handler has handled since the last reset() call.

reset
void reset()

Resets this handler's internal message cache to an empty list.

Inherited Members

From LogHandler

handle
void handle(LogMessage msg)

Handles a log message.