#include <ored/utilities/log.hpp>
Public Member Functions | |
BufferLogger (unsigned minLevel=64) | |
Constructor. More... | |
virtual | ~BufferLogger () |
Destructor. More... | |
virtual void | log (unsigned, const std::string &) override |
The log callback. More... | |
bool | hasNext () |
Checks if Logger has new messages. More... | |
std::string | next () |
Retrieve new messages. More... | |
Public Member Functions inherited from Logger | |
virtual | ~Logger () |
Destructor. More... | |
virtual void | log (unsigned level, const std::string &s)=0 |
The Log call back function. More... | |
const std::string & | name () |
Returns the Logger name. More... | |
Static Public Attributes | |
static const std::string | name = "BufferLogger" |
the name "BufferLogger" More... | |
Private Attributes | |
std::queue< std::string > | buffer_ |
unsigned | minLevel_ |
Additional Inherited Members | |
Protected Member Functions inherited from Logger | |
Logger (const std::string &name) | |
Constructor. More... | |
This logger stores each log message in an internal buffer, it can then be probed for log messages at a later point. Log messages are always returned in a FIFO order.
Typical usage to display log messages would be
while (bLogger.hasNext()) { MsgBox("Log Message", bLogger.next()); }
BufferLogger | ( | unsigned | minLevel = 64 | ) |
Constructor.
Definition at line 233 of file log.hpp.
|
virtual |
|
overridevirtual |
bool hasNext | ( | ) |
Checks if Logger has new messages.
Definition at line 73 of file log.cpp.
string next | ( | ) |
Retrieve new messages.
Retrieve the next new message from the buffer, this will throw if the buffer is empty. Messages are returned in a FIFO order. Messages are deleted from the buffer once returned.
|
static |