Chatsync  bbffde5c0c672a526bdc83637acf66dc20a80fbf
logging::LogWriter< s > Class Template Reference

#include <logging.hpp>

Public Member Functions

 LogWriter ()
 
 ~LogWriter ()
 
template<typename T >
LogWriteroperator<< (const T &log_object)
 

Private Attributes

std::stringstream _message
 
const std::chrono::high_resolution_clock::time_point _timestamp
 

Detailed Description

template<Severity s>
class logging::LogWriter< s >

The in-code writer object. Should be used when the actual logging is needed.

The timestamp is taken when the object created but the message may be constructed for a while after then and the actual sending to the logger happens on the object destroy. So the logging gets latency but won't make freezes during the program run.

Constructor & Destructor Documentation

§ LogWriter()

template<Severity s>
logging::LogWriter< s >::LogWriter ( )
inline

§ ~LogWriter()

template<Severity s>
logging::LogWriter< s >::~LogWriter ( )
inline

Member Function Documentation

§ operator<<()

template<Severity s>
template<typename T >
LogWriter& logging::LogWriter< s >::operator<< ( const T &  log_object)
inline

The main logging function. Every log object should be pushed there using the LogWriter::operator<<()

Field Documentation

§ _message

template<Severity s>
std::stringstream logging::LogWriter< s >::_message
private

§ _timestamp

template<Severity s>
const std::chrono::high_resolution_clock::time_point logging::LogWriter< s >::_timestamp
private

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