OpenWalnut
1.4.0
|
Resource class for streamed logging. More...
#include <WLogger.h>
Classes | |
class | Buffer |
Actually implementing the streaming functionality. More... | |
Public Member Functions | |
WStreamedLogger (const std::string &source, LogLevel level) | |
Creates new streamed logger instance. | |
template<typename T > | |
WStreamedLogger | operator<< (const T &loggable) |
Appends something loggable (to std::string castable) to the log. | |
WStreamedLogger | operator<< (StreamManipulatorFunctor manip) |
This is totally crazy man! Don't get dizzy on that, watch out and ask a C++ guru next to your side, which is probably named Christian or have a look on that: http://stackoverflow.com/questions/1134388/stdendl-is-of-unknown-type-when-overloading-operator. | |
Private Member Functions | |
WStreamedLogger & | operator= (const WStreamedLogger &rhs) |
Forbid assignment. | |
Private Attributes | |
boost::shared_ptr< Buffer > | m_buffer |
Collects the message parts. |
wlog::WStreamedLogger::WStreamedLogger | ( | const std::string & | source, |
LogLevel | level | ||
) | [inline] |
Creates new streamed logger instance.
Logging is deferred until destruction of this instance.
source | Source from which the log message originates |
level | The LogLevel of the message |
Definition at line 254 of file WLogger.h.
Referenced by wlog::_wlog().
WStreamedLogger wlog::WStreamedLogger::operator<< | ( | const T & | loggable | ) | [inline] |
WStreamedLogger wlog::WStreamedLogger::operator<< | ( | StreamManipulatorFunctor | manip | ) | [inline] |
This is totally crazy man! Don't get dizzy on that, watch out and ask a C++ guru next to your side, which is probably named Christian or have a look on that: http://stackoverflow.com/questions/1134388/stdendl-is-of-unknown-type-when-overloading-operator.
Allow std::endl to be streamed into log messages.
manip | Function pointer e.g. std::endl, std::flush, std::ends |
Definition at line 266 of file WLogger.h.
References m_buffer.
WStreamedLogger& wlog::WStreamedLogger::operator= | ( | const WStreamedLogger & | rhs | ) | [private] |
Forbid assignment.
rhs | The instance which SHOULD be copied over |
boost::shared_ptr< Buffer > wlog::WStreamedLogger::m_buffer [private] |