CppTrail
Loading...
Searching...
No Matches
CppTrail::AsyncCoutLogger Class Reference

A specialized asynchronous logger handle targeting the standard output stream (std::cout). More...

#include <ostream_logger.h>

Inheritance diagram for CppTrail::AsyncCoutLogger:
Collaboration diagram for CppTrail::AsyncCoutLogger:

Public Member Functions

 AsyncCoutLogger ()
 Constructs a CoutAsyncLogger initialized with the std::cout 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.
 
BasicLoggeroperator= (const BasicLogger &pLogger)=default
 Assignment operator.
 
BasicLoggeroperator= (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.
 
BasicLoggerlog (message_type oMessage)
 Submits a pre-constructed message object to the logger.
 
BasicLoggerlog (const Level nLevel, string_type sMessage)
 Logs a message with a specific severity level.
 
BasicLoggerlog (string_type sLevel, string_type sMessage)
 Logs a message with a custom string-based level.
 
BasicLoggersuccess (string_type sMessage)
 Submits a SUCCESS level log message.
 
BasicLoggertrace (string_type sMessage)
 Submits a TRACE level log message.
 
BasicLoggerdebug (string_type sMessage)
 Submits a DEBUG level log message.
 
BasicLoggerinfo (string_type sMessage)
 Submits an INFO level log message.
 
BasicLoggermessage (string_type sMessage)
 Submits a MESSAGE level log message.
 
BasicLoggerwarning (string_type sMessage)
 Submits a WARNING level log message.
 
BasicLoggererror (string_type sMessage)
 Submits an ERROR level log message.
 
BasicLoggercritical (string_type sMessage)
 Submits a CRITICAL level log message.
 
BasicLoggerfatal (string_type sMessage)
 Submits a FATAL level log message.
 
BasicLoggersuccess (string_view_type sMsg)
 Success wrapper for string views.
 
BasicLoggertrace (string_view_type sMsg)
 Trace wrapper for string views.
 
BasicLoggerdebug (string_view_type sMsg)
 Debug wrapper for string views.
 
BasicLoggerinfo (string_view_type sMsg)
 Info wrapper for string views.
 
BasicLoggermessage (string_view_type sMsg)
 Message wrapper for string views.
 
BasicLoggerwarning (string_view_type sMsg)
 Warning wrapper for string views.
 
BasicLoggererror (string_view_type sMsg)
 Error wrapper for string views.
 
BasicLoggercritical (string_view_type sMsg)
 Critical wrapper for string views.
 
BasicLoggerfatal (string_view_type sMsg)
 Fatal wrapper for string views.
 
BasicLoggersuccess (const char_t *sMsg)
 Success wrapper for string litterals.
 
BasicLoggertrace (const char_t *sMsg)
 Trace wrapper for string litterals.
 
BasicLoggerdebug (const char_t *sMsg)
 Debug wrapper for string litterals.
 
BasicLoggerinfo (const char_t *sMsg)
 Info wrapper for string litterals.
 
BasicLoggermessage (const char_t *sMsg)
 Message wrapper for string litterals.
 
BasicLoggerwarning (const char_t *sMsg)
 Warning wrapper for string litterals.
 
BasicLoggererror (const char_t *sMsg)
 Error wrapper for string litterals.
 
BasicLoggercritical (const char_t *sMsg)
 Critical wrapper for string litterals.
 
BasicLoggerfatal (const char_t *sMsg)
 Fatal wrapper for string litterals.
 
BasicLoggerlog (const Level nLevel, string_view_type sMessage)
 Logs a message view with a specific severity level.
 
BasicLoggerlog (string_type sLevel, string_view_type sMessage)
 Logs a message view with a custom string level.
 
BasicLoggerlog (const Level nLevel, const char_t *sMessage)
 Logs a message view with a specific severity level.
 
BasicLoggerlog (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>
BasicLoggerlog (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>
BasicLoggerlog (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>
BasicLoggerlog (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.
 

Detailed Description

A specialized asynchronous logger handle targeting the standard output stream (std::cout).

This class provides a non-blocking wrapper for console output. By utilizing the underlying AsyncOstreamLogger architecture, log submissions return immediately while a background thread handles the actual terminal I/O. This is ideal for high-frequency diagnostic data where blocking the main thread for console scrolling or terminal latency would skew performance metrics.

Note
As an asynchronous logger, it requires an explicit start() call to begin processing the queue.

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