LogIt++
Header-only, macro-first C++ logging library
Loading...
Searching...
No Matches
logit::CrashWindowsLogger Class Reference

\class CrashWindowsLogger \brief Stub implementation on non-Windows platforms. More...

#include <CrashWindowsLogger.hpp>

Inheritance diagram for logit::CrashWindowsLogger:
logit::ILogger

Classes

struct  Config
 

Public Member Functions

 CrashWindowsLogger ()=default
 
 CrashWindowsLogger (const Config &)
 
void log (const LogRecord &record, const std::string &message) override
 Logs a message.
 
std::string get_string_param (const LoggerParam &param) const override
 Retrieves a string parameter from the logger.
 
int64_t get_int_param (const LoggerParam &param) const override
 Retrieves an integer parameter from the logger.
 
double get_float_param (const LoggerParam &param) const override
 Retrieves a floating-point parameter from the logger.
 
void set_log_level (LogLevel level) override
 Sets the minimal log level for this logger.
 
LogLevel get_log_level () const override
 Gets the minimal log level for this logger.
 
void wait () override
 Waits for all asynchronous logging operations to complete.
 
- Public Member Functions inherited from logit::ILogger
virtual ~ILogger ()=default
 
virtual std::vector< std::string > get_buffered_strings () const
 Returns buffered formatted messages in chronological order.
 
virtual std::vector< BufferedLogEntry > get_buffered_entries () const
 Returns buffered structured entries in chronological order.
 
virtual std::vector< LogFileInfo > list_log_files () const
 Lists persisted log files owned by this backend.
 
virtual LogFileReadResult read_log_file (const std::string &path) const
 Reads one persisted log file owned by this backend.
 
virtual std::vector< LogFileReadResult > read_log_files (const std::vector< std::string > &paths) const
 Reads several persisted log files owned by this backend.
 
virtual LogClearResult clear_logs (const LogClearOptions &options=LogClearOptions())
 Clears logger-owned buffered or persisted records when supported.
 
virtual void shutdown ()
 Stops logger-owned asynchronous resources after draining pending work.
 

Static Public Member Functions

static void install_exception_handler ()
 

Static Public Attributes

static constexpr std::size_t kMaxBufferSize = 0
 
static constexpr std::size_t kDefaultBufferSize = 0
 

Detailed Description

\class CrashWindowsLogger \brief Stub implementation on non-Windows platforms.

Definition at line 292 of file CrashWindowsLogger.hpp.

Constructor & Destructor Documentation

◆ CrashWindowsLogger() [1/2]

logit::CrashWindowsLogger::CrashWindowsLogger ( )
default

◆ CrashWindowsLogger() [2/2]

logit::CrashWindowsLogger::CrashWindowsLogger ( const Config & )
inlineexplicit

Definition at line 303 of file CrashWindowsLogger.hpp.

Member Function Documentation

◆ get_float_param()

double logit::CrashWindowsLogger::get_float_param ( const LoggerParam & param) const
inlineoverridevirtual

Retrieves a floating-point parameter from the logger.

Derived classes should implement this to return specific floating-point-based parameters.

Parameters
paramThe parameter type to retrieve.
Returns
A double representing the requested parameter.

Implements logit::ILogger.

Definition at line 320 of file CrashWindowsLogger.hpp.

◆ get_int_param()

int64_t logit::CrashWindowsLogger::get_int_param ( const LoggerParam & param) const
inlineoverridevirtual

Retrieves an integer parameter from the logger.

Derived classes should implement this to return specific integer-based parameters.

Parameters
paramThe parameter type to retrieve.
Returns
An integer representing the requested parameter.

Implements logit::ILogger.

Definition at line 315 of file CrashWindowsLogger.hpp.

◆ get_log_level()

LogLevel logit::CrashWindowsLogger::get_log_level ( ) const
inlineoverridevirtual

Gets the minimal log level for this logger.

Returns
Current minimal log level.

Implements logit::ILogger.

Definition at line 329 of file CrashWindowsLogger.hpp.

◆ get_string_param()

std::string logit::CrashWindowsLogger::get_string_param ( const LoggerParam & param) const
inlineoverridevirtual

Retrieves a string parameter from the logger.

Derived classes should implement this to return specific string-based parameters.

Parameters
paramThe parameter type to retrieve.
Returns
A string representing the requested parameter.

Implements logit::ILogger.

Definition at line 310 of file CrashWindowsLogger.hpp.

◆ install_exception_handler()

static void logit::CrashWindowsLogger::install_exception_handler ( )
inlinestatic

Definition at line 335 of file CrashWindowsLogger.hpp.

◆ log()

void logit::CrashWindowsLogger::log ( const LogRecord & record,
const std::string & message )
inlineoverridevirtual

Logs a message.

This pure virtual function must be implemented by derived logger classes. It handles the logging of messages, which could be output to a console, file, or other destinations.

Parameters
recordThe log record containing details about the log event.
messageThe formatted log message.

Implements logit::ILogger.

Definition at line 305 of file CrashWindowsLogger.hpp.

◆ set_log_level()

void logit::CrashWindowsLogger::set_log_level ( LogLevel level)
inlineoverridevirtual

Sets the minimal log level for this logger.

Parameters
levelMinimum log level.

Implements logit::ILogger.

Definition at line 325 of file CrashWindowsLogger.hpp.

◆ wait()

void logit::CrashWindowsLogger::wait ( )
inlineoverridevirtual

Waits for all asynchronous logging operations to complete.

This pure virtual function must be implemented by derived logger classes. It ensures that any pending log messages are fully processed, especially when logging asynchronously.

Implements logit::ILogger.

Definition at line 333 of file CrashWindowsLogger.hpp.

Member Data Documentation

◆ kDefaultBufferSize

std::size_t logit::CrashWindowsLogger::kDefaultBufferSize = 0
staticconstexpr

Definition at line 295 of file CrashWindowsLogger.hpp.

◆ kMaxBufferSize

std::size_t logit::CrashWindowsLogger::kMaxBufferSize = 0
staticconstexpr

Definition at line 294 of file CrashWindowsLogger.hpp.


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