Chatsync
bbffde5c0c672a526bdc83637acf66dc20a80fbf
|
#include <logging.hpp>
Public Member Functions | |
LogWriter () | |
~LogWriter () | |
template<typename T > | |
LogWriter & | operator<< (const T &log_object) |
Private Attributes | |
std::stringstream | _message |
const std::chrono::high_resolution_clock::time_point | _timestamp |
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.
|
inline |
|
inline |
|
inline |
The main logging function. Every log object should be pushed there using the LogWriter::operator<<()
|
private |
|
private |