KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
Loading...
Searching...
No Matches
LogConsumer Class Reference

A QObject-based sink that receives log entries from the logging system. More...

#include <logconsumer.h>

+ Inheritance diagram for LogConsumer:
+ Collaboration diagram for LogConsumer:

Signals

void logEntry (const Log::LogEntry &entry)
 Emitted when a new log entry is delivered to this consumer.
 

Public Member Functions

 LogConsumer (QObject *parent=nullptr)
 Construct a LogConsumer with an optional parent.
 
virtual ~LogConsumer ()
 Destructor — automatically unregisters from the system logger.
 
void addLogEntry (const Log::LogEntry &entry)
 Deliver a log entry to this consumer, emitting the logEntry() signal.
 

Detailed Description

A QObject-based sink that receives log entries from the logging system.

Abstract base class for objects that receive and process log entries.

Subclass LogConsumer and implement the logEntry() signal handler, or connect to the logEntry() signal, to receive all log entries delivered to this consumer. Register the consumer with Log::addConsumer().

Definition at line 20 of file logconsumer.h.

Constructor & Destructor Documentation

◆ LogConsumer()

LogConsumer::LogConsumer ( QObject *  parent = nullptr)
explicit

Construct a LogConsumer with an optional parent.

Parameters
parentOptional QObject parent

Member Function Documentation

◆ addLogEntry()

void LogConsumer::addLogEntry ( const Log::LogEntry entry)

Deliver a log entry to this consumer, emitting the logEntry() signal.

Parameters
entryLog entry to deliver

◆ logEntry

void LogConsumer::logEntry ( const Log::LogEntry entry)
signal

Emitted when a new log entry is delivered to this consumer.

Parameters
entryThe delivered log entry

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