|
CppTrail
|
Abstract template interface defining the mandatory contract for all loggers. More...
#include <base_logger.h>

Public Types | |
| using | char_type = char_t |
| Alias for the underlying character type used by this logger. | |
| using | string_type = std::basic_string< char_type > |
| Alias for the basic_string type associated with this logger's encoding. | |
| using | message_type = BasicMessage< char_type > |
| Alias for the BasicMessage type associated to the logger. | |
| using | string_view_type = std::basic_string_view< char_type > |
| Alias for the basic_string_view type associated with this logger's encoding. | |
Public Member Functions | |
| virtual | ~BasicLoggerImpl ()=default |
| Virtual destructor to ensure proper cleanup of derived logger resources. | |
| virtual void | log (message_type oMessage)=0 |
| Primary interface for submitting a log record. | |
| virtual void | start ()=0 |
| Synchronously starts the logger service. | |
| virtual void | stop ()=0 |
| Synchronously stops the logger service. | |
| virtual void | signalStop ()=0 |
| Asynchronously signals the logger to initiate a shutdown sequence. | |
| virtual void | join ()=0 |
| Waits for the asynchronous end of the shutdown sequence. | |
| virtual Status | status ()=0 |
| Retrieves the current operational health and state of the logger. | |
Abstract template interface defining the mandatory contract for all loggers.
This template serves as the foundation for both synchronous and asynchronous implementations. It abstracts the character type to allow native support for multiple encodings (UTF-8, UTF-16, etc.) across different logging sinks.
| char_t | The character type (e.g., char, char8_t, wchar_t) used for log data. |
|
pure virtual |
Waits for the asynchronous end of the shutdown sequence.
This function is used in conjunction with signalStop() to ensure description safety.
Implemented in CppTrail::BasicAsyncLoggerImpl< char_t >, and CppTrail::BasicSyncLoggerImpl< char_t >.
|
pure virtual |
Primary interface for submitting a log record.
| oMessage | The message to be processed. |
Implemented in CppTrail::BasicAsyncLoggerImpl< char_t >, and CppTrail::BasicSyncLoggerImpl< char_t >.
|
pure virtual |
Asynchronously signals the logger to initiate a shutdown sequence.
Unlike stop(), this returns immediately, allowing the logger to shut down in the background (typically via a dedicated "killer" thread).
Implemented in CppTrail::BasicAsyncLoggerImpl< char_t >, and CppTrail::BasicSyncLoggerImpl< char_t >.
|
pure virtual |
Synchronously starts the logger service.
This call blocks the calling thread until the logger's internal status reaches Status::RUNNING.
Implemented in CppTrail::BasicAsyncLoggerImpl< char_t >, and CppTrail::BasicSyncLoggerImpl< char_t >.
|
pure virtual |
Retrieves the current operational health and state of the logger.
Implemented in CppTrail::BasicAsyncLoggerImpl< char_t >, and CppTrail::BasicSyncLoggerImpl< char_t >.
|
pure virtual |
Synchronously stops the logger service.
This call blocks until all workers are joined and the status reaches Status::STOPPED. Implementation-defined behavior determines if the remaining queue is flushed before exit.
Implemented in CppTrail::BasicAsyncLoggerImpl< char_t >, and CppTrail::BasicSyncLoggerImpl< char_t >.