Adapts mi::base::ILogger to a standard streaming interface. More...
#include <ilogger.h>
Inherits std::ostream.
Public Member Functions | |
Log_stream (ILogger *logger, const char *module_category, Message_severity default_level=MESSAGE_SEVERITY_INFO, const Message_details &default_details=Message_details()) | |
Constructor. More... | |
Log_stream (ILogger *logger, const std::string &module_category, Message_severity default_level=MESSAGE_SEVERITY_INFO, const Message_details &default_details=Message_details()) | |
Constructor. More... | |
~Log_stream () throw () | |
Destructor. More... | |
void | set_log_level (Message_severity level) |
Flushes the buffer if not empty, and sets the log level of the next message to the given log level. More... | |
void | set_details (const Message_details &details) |
Flushes the buffer if not empty, and sets the message details of the next message. More... | |
Adapts mi::base::ILogger to a standard streaming interface.
Messages are forwarded to the logger whenever the stream is flushed. The log level for the next message can be changed by using one of the manipulators fatal, error, warning, info, verbose, or debug, which correspond to the values of mi::base::details::Message_severity. The log details can be changed by pushing an instance of mi::base::details;:Message_details into the stream. Changing the log level or the details also triggers flushing.
Example: