libdrmconf
0.10.4
A library to program DMR radios.
|
A log-handler that dumps log-messages into a QTextStream
.
More...
#include <logger.hh>
Public Member Functions | |
StreamLogHandler (QTextStream &stream, LogMessage::Level minLevel=LogMessage::DEBUG, bool color=false, QObject *parent=nullptr) | |
Constructor. More... | |
LogMessage::Level | minLevel () const |
Returns the minimum log level. | |
void | setMinLevel (LogMessage::Level minLevel) |
Resets the minimum log level. | |
void | handle (const LogMessage &message) |
Callback to handle log messages. | |
Public Member Functions inherited from LogHandler | |
LogHandler (QObject *parent=nullptr) | |
Constructor. | |
virtual | ~LogHandler () |
Destructor. | |
Protected Attributes | |
QTextStream & | _stream |
A reference to the text stream to log into. | |
LogMessage::Level | _minLevel |
The minimum log level. | |
bool | _color |
If true, write messages using console colors. | |
A log-handler that dumps log-messages into a QTextStream
.
StreamLogHandler::StreamLogHandler | ( | QTextStream & | stream, |
LogMessage::Level | minLevel = LogMessage::DEBUG , |
||
bool | color = false , |
||
QObject * | parent = nullptr |
||
) |
Constructor.
stream | Specifies the text stream to log into. |
minLevel | Specifies the minimum log-level to log. |
color | If true , the output will be colored. |
parent | Specifies the parent object. |