libdrmconf  0.10.4
A library to program DMR radios.
Public Member Functions | Protected Attributes | List of all members
StreamLogHandler Class Reference

A log-handler that dumps log-messages into a QTextStream. More...

#include <logger.hh>

Inheritance diagram for StreamLogHandler:
Inheritance graph
[legend]
Collaboration diagram for StreamLogHandler:
Collaboration graph
[legend]

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.
 

Detailed Description

A log-handler that dumps log-messages into a QTextStream.

Constructor & Destructor Documentation

◆ StreamLogHandler()

StreamLogHandler::StreamLogHandler ( QTextStream &  stream,
LogMessage::Level  minLevel = LogMessage::DEBUG,
bool  color = false,
QObject *  parent = nullptr 
)

Constructor.

Parameters
streamSpecifies the text stream to log into.
minLevelSpecifies the minimum log-level to log.
colorIf true, the output will be colored.
parentSpecifies the parent object.

The documentation for this class was generated from the following files: