Base class for all desktop logger backend implementations. More...
#include <DesktopLoggerBackends.h>
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< FormativeFactory > | format_factory |
| std::shared_ptr< LoggerBaseConsumer > | message_consume_backend |
Base class for all desktop logger backend implementations.
Provides core functionality for message processing and routing between formatters and consumers, with thread-safe operations.
Status codes for log processing operations.
| Enumerator | |
|---|---|
| LogSuccess | Message was processed successfully |
| LogDisabled | Logger is currently disabled |
| LogFailed | Message processing failed |
| DesktopLoggerBackends::DesktopLoggerBackends | ( | std::shared_ptr< FormativeFactory > | factory, |
| std::shared_ptr< LoggerBaseConsumer > | consumer | ||
| ) |
Constructs a logger backend with formatter and consumer.
| factory | The message formatter factory |
| consumer | The message consumer backend |
| void DesktopLoggerBackends::hot_install_consumer | ( | std::shared_ptr< LoggerBaseConsumer > | consumer | ) |
Replaces the message consumer at runtime.
| consumer | The new consumer backend to install |
| void DesktopLoggerBackends::hot_install_factory | ( | std::shared_ptr< FormativeFactory > | factory | ) |
Replaces the formatter factory at runtime.
| factory | The new formatter factory to install |
|
pure virtual |
Posts the current status of the logger.
Implemented in ConsoleLogger.
|
virtual |
Processes a log message through formatter and consumer.
| type | The message severity type |
| context | The logging context information |
| msg | The message content |
|
protected |
Current enabled state of the logger
|
protected |
Message formatter
|
protected |
Mutex for thread-safe operations
|
protected |
Message consumer