|
CppTrail
|
A specialized asynchronous logger handle targeting the standard error stream (std::cerr). More...
#include <ostream_logger.h>


Public Member Functions | |
| AsyncCerrLogger () | |
| Constructs a CerrAsyncLogger initialized with the std::cerr sink. | |
Public Member Functions inherited from CppTrail::BasicAsyncOstreamLogger< char_t > | |
| BasicAsyncOstreamLogger (std::basic_ostream< char_t > &oOstream, const bool bUseLocalTime=true) | |
| Constructs a AsyncLogger from a raw stream reference. | |
| BasicAsyncOstreamLogger (std::reference_wrapper< std::basic_ostream< char_t > > oOstream, const bool bUseLocalTime=true) | |
| Constructs a AsyncLogger from a reference_wrapper. | |
| BasicAsyncOstreamLogger (std::reference_wrapper< std::basic_ostream< char_t > > oOstream, const bool bUseLocalTime, std::size_t nMaxEntryCount, bool bThrowOnOverflow) | |
| Constructs a AsyncLogger from a reference_wrapper. | |
Public Member Functions inherited from CppTrail::BasicLogger< char_t > | |
| BasicLogger (nullptr_t)=delete | |
| Prevents construction from a null pointer. | |
| BasicLogger (const BasicLogger &pLogger)=default | |
| Copy constructor (defaults to shared ownership). | |
| BasicLogger (BasicLogger &&pLogger)=default | |
| Move constructor. | |
| BasicLogger & | operator= (const BasicLogger &pLogger)=default |
| Assignment operator. | |
| BasicLogger & | operator= (BasicLogger &&pLogger)=default |
| Assignment operator. | |
| void | start () |
| Starts the underlying logging service. | |
| void | stop () |
| Performs a synchronous shutdown of the logger. | |
| void | signalStop () |
| Initiates an asynchronous shutdown request. | |
| void | join () |
| Blocks until the asynchronous shutdown sequence is complete. | |
| Status | status () |
| Retrieves the current operational status of the logger. | |
| BasicLogger & | log (message_type oMessage) |
| Submits a pre-constructed message object to the logger. | |
| BasicLogger & | log (const Level nLevel, string_type sMessage) |
| Logs a message with a specific severity level. | |
| BasicLogger & | log (string_type sLevel, string_type sMessage) |
| Logs a message with a custom string-based level. | |
| BasicLogger & | success (string_type sMessage) |
| Submits a SUCCESS level log message. | |
| BasicLogger & | trace (string_type sMessage) |
| Submits a TRACE level log message. | |
| BasicLogger & | debug (string_type sMessage) |
| Submits a DEBUG level log message. | |
| BasicLogger & | info (string_type sMessage) |
| Submits an INFO level log message. | |
| BasicLogger & | message (string_type sMessage) |
| Submits a MESSAGE level log message. | |
| BasicLogger & | warning (string_type sMessage) |
| Submits a WARNING level log message. | |
| BasicLogger & | error (string_type sMessage) |
| Submits an ERROR level log message. | |
| BasicLogger & | critical (string_type sMessage) |
| Submits a CRITICAL level log message. | |
| BasicLogger & | fatal (string_type sMessage) |
| Submits a FATAL level log message. | |
| BasicLogger & | success (string_view_type sMsg) |
| Success wrapper for string views. | |
| BasicLogger & | trace (string_view_type sMsg) |
| Trace wrapper for string views. | |
| BasicLogger & | debug (string_view_type sMsg) |
| Debug wrapper for string views. | |
| BasicLogger & | info (string_view_type sMsg) |
| Info wrapper for string views. | |
| BasicLogger & | message (string_view_type sMsg) |
| Message wrapper for string views. | |
| BasicLogger & | warning (string_view_type sMsg) |
| Warning wrapper for string views. | |
| BasicLogger & | error (string_view_type sMsg) |
| Error wrapper for string views. | |
| BasicLogger & | critical (string_view_type sMsg) |
| Critical wrapper for string views. | |
| BasicLogger & | fatal (string_view_type sMsg) |
| Fatal wrapper for string views. | |
| BasicLogger & | success (const char_t *sMsg) |
| Success wrapper for string litterals. | |
| BasicLogger & | trace (const char_t *sMsg) |
| Trace wrapper for string litterals. | |
| BasicLogger & | debug (const char_t *sMsg) |
| Debug wrapper for string litterals. | |
| BasicLogger & | info (const char_t *sMsg) |
| Info wrapper for string litterals. | |
| BasicLogger & | message (const char_t *sMsg) |
| Message wrapper for string litterals. | |
| BasicLogger & | warning (const char_t *sMsg) |
| Warning wrapper for string litterals. | |
| BasicLogger & | error (const char_t *sMsg) |
| Error wrapper for string litterals. | |
| BasicLogger & | critical (const char_t *sMsg) |
| Critical wrapper for string litterals. | |
| BasicLogger & | fatal (const char_t *sMsg) |
| Fatal wrapper for string litterals. | |
| BasicLogger & | log (const Level nLevel, string_view_type sMessage) |
| Logs a message view with a specific severity level. | |
| BasicLogger & | log (string_type sLevel, string_view_type sMessage) |
| Logs a message view with a custom string level. | |
| BasicLogger & | log (const Level nLevel, const char_t *sMessage) |
| Logs a message view with a specific severity level. | |
| BasicLogger & | log (string_type sLevel, const char_t *sMessage) |
| Logs a message view with a custom string level. | |
| template<typename T = char_t, typename std::enable_if< std::is_same< T, char >::value, int >::type = 0> | |
| BasicLogger & | log (const std::exception &oException) |
| Logs an exception with the default ERROR level. | |
| template<typename T = char_t, typename std::enable_if< std::is_same< T, char >::value, int >::type = 0> | |
| BasicLogger & | log (const Level nLevel, const std::exception &oException) |
| Logs an exception with a specific severity level. | |
| template<typename T = char_t, typename std::enable_if< std::is_same< T, char >::value, int >::type = 0> | |
| BasicLogger & | log (string_type sLevel, const std::exception &oException) |
| Logs an exception with a custom string level. | |
Additional Inherited Members | |
Public Types inherited from CppTrail::BasicLogger< char_t > | |
| using | char_type = typename BasicLoggerImpl< char_t >::char_type |
| Alias for the underlying character type used by this logger. | |
| using | string_type = typename BasicLoggerImpl< char_t >::string_type |
| Alias for the basic_string type associated with this logger's encoding. | |
| using | message_type = typename BasicLoggerImpl< char_t >::message_type |
| Alias for the BasicMessage type associated to the logger. | |
| using | string_view_type = typename BasicLoggerImpl< char_t >::string_view_type |
| Alias for the basic_string_view type associated with this logger's encoding. | |
Protected Member Functions inherited from CppTrail::BasicLogger< char_t > | |
| BasicLogger (std::shared_ptr< BasicLoggerImpl< char_t > > pLogger) | |
| Protected constructor for derived factories. | |
| ~BasicLogger () | |
| Destructor that ensures a graceful shutdown of the logger. | |
A specialized asynchronous logger handle targeting the standard error stream (std::cerr).
Provides a non-blocking channel for high-priority alerts and error reporting. Unlike standard std::cerr, which is unbuffered and blocking, this class offloads the error reporting to a background worker. This ensures that even during a catastrophic failure or "wire stuff" crash, the error messages are queued and flushed without freezing the remaining logic of the application.