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

Stub implementation on non-POSIX platforms. More...

#include <CrashPosixLogger.hpp>

Inheritance diagram for logit::CrashPosixLogger:
logit::ILogger

Classes

struct  Config
 

Public Member Functions

 CrashPosixLogger ()=default
 
 CrashPosixLogger (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_signal_handler (int signo)
 

Static Public Attributes

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

Detailed Description

Stub implementation on non-POSIX platforms.

Definition at line 296 of file CrashPosixLogger.hpp.

Constructor & Destructor Documentation

◆ CrashPosixLogger() [1/2]

logit::CrashPosixLogger::CrashPosixLogger ( )
default

◆ CrashPosixLogger() [2/2]

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

Definition at line 307 of file CrashPosixLogger.hpp.

Member Function Documentation

◆ get_float_param()

double logit::CrashPosixLogger::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 324 of file CrashPosixLogger.hpp.

◆ get_int_param()

int64_t logit::CrashPosixLogger::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 319 of file CrashPosixLogger.hpp.

◆ get_log_level()

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

Gets the minimal log level for this logger.

Returns
Current minimal log level.

Implements logit::ILogger.

Definition at line 333 of file CrashPosixLogger.hpp.

◆ get_string_param()

std::string logit::CrashPosixLogger::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 314 of file CrashPosixLogger.hpp.

◆ install_signal_handler()

static void logit::CrashPosixLogger::install_signal_handler ( int signo)
inlinestatic

Definition at line 339 of file CrashPosixLogger.hpp.

◆ log()

void logit::CrashPosixLogger::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 309 of file CrashPosixLogger.hpp.

◆ set_log_level()

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

Sets the minimal log level for this logger.

Parameters
levelMinimum log level.

Implements logit::ILogger.

Definition at line 329 of file CrashPosixLogger.hpp.

◆ wait()

void logit::CrashPosixLogger::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 337 of file CrashPosixLogger.hpp.

Member Data Documentation

◆ kDefaultBufferSize

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

Definition at line 299 of file CrashPosixLogger.hpp.

◆ kMaxBufferSize

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

Definition at line 298 of file CrashPosixLogger.hpp.


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