Compounds | |
class | utils::logging::dolog |
a dolog object collects log messages and sends it to the logger. More... | |
struct | utils::logging::file_listener |
a listener writing to a file. More... | |
class | utils::logging::listener |
a log listener receives log messages. More... | |
struct | utils::logging::logfunc |
the logging function object. More... | |
class | utils::logging::logger |
the logging object. More... | |
class | utils::logging::msg |
a message prepared for logging. More... | |
struct | utils::logging::nolog |
a dummy class with the same interface as the dolog class. More... | |
struct | utils::logging::ostream_listener |
a listener writing on a ostream. More... | |
Functions | |
const dolog & | operator<< (const dolog &l, const string &s) |
A special string logging operator. More... | |
template<class T> const dolog & | operator<< (const dolog &l, const T &val) |
The logging operator. More... | |
template<class T> const nolog & | operator<< (const nolog &l, const T &val) |
To start logging (i.e. that you really can see what is logged from inside the application, you must create at least one listener object. Usually you would do it via the listener<F> template class, but feel free to derive from listener by hand.
Beware, that the onMsg() method of listener objects will execute within the logging thread. Therefore you might have to do some efforts to achieve threadsafeness of your logging class.
Except for deriving from listener you would never use any of these classes directly. Use the provided macros (log, dlog, LOG, and DLOG) instead:
log << "What the hell is going on?" << endl; string answer = "I don't know either."; LOG(answer); dlog << "This I tell you in debug mode only." << endl; DLOG(answer.length());
|
|
|
The logging operator. The functionality is borrowed from the iostream library. |
|
A special string logging operator. It encloses the string into '\"' characters. |