CCIMXDesktop
 
Loading...
Searching...
No Matches
DesktopLoggerBackends Class Referenceabstract

Base class for all desktop logger backend implementations. More...

#include <DesktopLoggerBackends.h>

Inheritance diagram for DesktopLoggerBackends:
ConsoleLogger

Public Types

enum  LogStatus { LogSuccess = 0 , LogDisabled = 1 , LogFailed = 2 }
 Status codes for log processing operations. More...
 

Public Member Functions

 DesktopLoggerBackends (std::shared_ptr< FormativeFactory > factory, std::shared_ptr< LoggerBaseConsumer > consumer)
 Constructs a logger backend with formatter and consumer.
 
virtual ~DesktopLoggerBackends ()=default
 Virtual destructor.
 
virtual LogStatus processMessage (QtMsgType type, const QMessageLogContext &context, const QString &msg)
 Processes a log message through formatter and consumer.
 
virtual bool postSelfStatus ()=0
 Posts the current status of the logger.
 
void hot_install_factory (std::shared_ptr< FormativeFactory > factory)
 Replaces the formatter factory at runtime.
 
void hot_install_consumer (std::shared_ptr< LoggerBaseConsumer > consumer)
 Replaces the message consumer at runtime.
 

Protected Attributes

bool enabled { true }
 
QMutex lock
 
std::shared_ptr< FormativeFactoryformat_factory
 
std::shared_ptr< LoggerBaseConsumermessage_consume_backend
 

Detailed Description

Base class for all desktop logger backend implementations.

Provides core functionality for message processing and routing between formatters and consumers, with thread-safe operations.

Member Enumeration Documentation

◆ LogStatus

Status codes for log processing operations.

Enumerator
LogSuccess 

Message was processed successfully

LogDisabled 

Logger is currently disabled

LogFailed 

Message processing failed

Constructor & Destructor Documentation

◆ DesktopLoggerBackends()

DesktopLoggerBackends::DesktopLoggerBackends ( std::shared_ptr< FormativeFactory factory,
std::shared_ptr< LoggerBaseConsumer consumer 
)

Constructs a logger backend with formatter and consumer.

Parameters
factoryThe message formatter factory
consumerThe message consumer backend

Member Function Documentation

◆ hot_install_consumer()

void DesktopLoggerBackends::hot_install_consumer ( std::shared_ptr< LoggerBaseConsumer consumer)

Replaces the message consumer at runtime.

Parameters
consumerThe new consumer backend to install

◆ hot_install_factory()

void DesktopLoggerBackends::hot_install_factory ( std::shared_ptr< FormativeFactory factory)

Replaces the formatter factory at runtime.

Parameters
factoryThe new formatter factory to install

◆ postSelfStatus()

virtual bool DesktopLoggerBackends::postSelfStatus ( )
pure virtual

Posts the current status of the logger.

Returns
true if status was posted successfully
Note
Pure virtual function must be implemented by derived classes

Implemented in ConsoleLogger.

◆ processMessage()

DesktopLoggerBackends::LogStatus DesktopLoggerBackends::processMessage ( QtMsgType  type,
const QMessageLogContext &  context,
const QString &  msg 
)
virtual

Processes a log message through formatter and consumer.

Parameters
typeThe message severity type
contextThe logging context information
msgThe message content
Returns
Status of the processing operation

Member Data Documentation

◆ enabled

bool DesktopLoggerBackends::enabled { true }
protected

Current enabled state of the logger

◆ format_factory

std::shared_ptr<FormativeFactory> DesktopLoggerBackends::format_factory
protected

Message formatter

◆ lock

QMutex DesktopLoggerBackends::lock
protected

Mutex for thread-safe operations

◆ message_consume_backend

std::shared_ptr<LoggerBaseConsumer> DesktopLoggerBackends::message_consume_backend
protected

Message consumer


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