A logger backend that outputs messages to the console. More...
#include <ConsoleLogger.h>
Public Types | |
| enum class | ConsoleFormatStyle { Plain , LoguruLike } |
| Defines the available formatting styles for console output. More... | |
Public Types inherited from DesktopLoggerBackends | |
| enum | LogStatus { LogSuccess = 0 , LogDisabled = 1 , LogFailed = 2 } |
| Status codes for log processing operations. More... | |
Public Member Functions | |
| ConsoleLogger (ConsoleFormatStyle type=ConsoleFormatStyle::Plain) | |
| Constructs a ConsoleLogger with specified format style. | |
| ~ConsoleLogger () override=default | |
| Destructor (default implementation) | |
| bool | postSelfStatus () override |
| Posts the current status of the logger to the console. | |
Public Member Functions inherited from DesktopLoggerBackends | |
| 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. | |
| 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. | |
Additional Inherited Members | |
Protected Attributes inherited from DesktopLoggerBackends | |
| bool | enabled { true } |
| QMutex | lock |
| std::shared_ptr< FormativeFactory > | format_factory |
| std::shared_ptr< LoggerBaseConsumer > | message_consume_backend |
A logger backend that outputs messages to the console.
This class implements a console-based logger that can format messages in different styles for console output.
|
strong |
|
explicit |
Constructs a ConsoleLogger with specified format style.
| type | The formatting style to use (defaults to Plain) |
|
overridevirtual |
Posts the current status of the logger to the console.
Implements DesktopLoggerBackends.