My Project
|
Logger handler used to process log messages. More...
#include <uuid/log.h>
Public Member Functions | |
virtual void | operator<< (std::shared_ptr< Message > message)=0 |
Add a new log message. More... | |
Private Attributes | |
friend | Logger |
Logger needs to be able to access the private reference to the registered log handlers. More... | |
std::weak_ptr< std::map< Handler *, Level > > | handlers_ |
Reference to registered log handlers. More... | |
|
pure virtual |
Add a new log message.
This should normally be put in a queue instead of being processed immediately so that log messages have minimal impact at the time of use.
Handlers must avoid holding a lock on a mutex used for adding messages while processing those messages. Release the lock while performing the processing.
Queues should have a maximum size and discard the oldest message when full.
It is not safe for the handler to directly or indirectly do any of the following while this function is being called:
[in] | message | New log message, shared by all handlers. |
Implemented in uuid::syslog::SyslogService, uuid::console::Shell, and uuid::log::PrintHandler.
|
private |