Public Member Functions | Private Attributes | List of all members
uuid::log::Handler Class Referenceabstract

Logger handler used to process log messages. More...

#include <uuid/log.h>

Inheritance diagram for uuid::log::Handler:
Inheritance graph
[legend]
Collaboration diagram for uuid::log::Handler:
Collaboration graph
[legend]

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...
 

Detailed Description

Logger handler used to process log messages.

Since
1.0.0

Definition at line 259 of file log.h.

Member Function Documentation

◆ operator<<()

virtual void uuid::log::Handler::operator<< ( std::shared_ptr< Message message)
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.

Queues should have a maximum size and discard the oldest message when full.

Parameters
[in]messageNew log message, shared by all handlers.
Since
1.0.0

Implemented in uuid::syslog::SyslogService, and uuid::console::Shell.

Member Data Documentation

◆ handlers_

std::weak_ptr<std::map<Handler*,Level> > uuid::log::Handler::handlers_
private

Reference to registered log handlers.

Used in the destructor to safely unregister the handler even if the underlying map has already been destroyed.

Since
2.1.2

Definition at line 297 of file log.h.

◆ Logger

friend uuid::log::Handler::Logger
private

Logger needs to be able to access the private reference to the registered log handlers.

Since
2.1.2

Definition at line 266 of file log.h.


The documentation for this class was generated from the following files: