BioCMAMC-ST
IO::Logger Class Referenceabstract

Base class for a generic logging system. More...

#include <logger.hpp>

Inheritance diagram for IO::Logger:
[legend]

Public Member Functions

 Logger ()=default
 Logger (const Logger &)=default
 Logger (Logger &&)=default
Loggeroperator= (const Logger &)=default
Loggeroperator= (Logger &&)=default
virtual ~Logger ()=default
virtual void debug (std::string_view message)=0
 Log a debug message.
virtual void print (std::string_view prefix, std::string_view message)=0
 Log a regular print message with a prefix.
virtual void alert (std::string_view prefix, std::string_view message)=0
 Log an alert message with a prefix.
virtual void error (std::string_view message, std::source_location location=std::source_location::current())=0
 Log an error message with optional location details.
virtual void raw_log (std::string_view message)=0
 Log a raw message with no additional formatting.
virtual void toggle_debug () noexcept=0
 Toggle the debug logging behavior on or off.
virtual void toggle_print () noexcept=0
 Toggle the print logging behavior on or off.
virtual void toggle_alert () noexcept=0
 Toggle the alert logging behavior on or off.
virtual void toggle_error () noexcept=0
 Toggle the error logging behavior on or off.
virtual void toggle_all () noexcept=0
 Toggle all logging types on or off.

Detailed Description

Base class for a generic logging system.

This class defines the interface for logging messages of various types

Constructor & Destructor Documentation

◆ Logger() [1/3]

IO::Logger::Logger ( )
default
Here is the caller graph for this function:

◆ Logger() [2/3]

IO::Logger::Logger ( const Logger & )
default
Here is the call graph for this function:

◆ Logger() [3/3]

IO::Logger::Logger ( Logger && )
default
Here is the call graph for this function:

◆ ~Logger()

virtual IO::Logger::~Logger ( )
virtualdefault

Member Function Documentation

◆ alert()

virtual void IO::Logger::alert ( std::string_view prefix,
std::string_view message )
pure virtual

Log an alert message with a prefix.

Logs an alert message that typically requires immediate attention.

Parameters
prefixA string prefix to prepend to the message.
messageThe message to log.

Implemented in IO::Console.

◆ debug()

virtual void IO::Logger::debug ( std::string_view message)
pure virtual

Log a debug message.

Logs a debug message with no prefix.

Parameters
messageThe message to log.

Implemented in IO::Console.

◆ error()

virtual void IO::Logger::error ( std::string_view message,
std::source_location location = std::source_location::current() )
pure virtual

Log an error message with optional location details.

Logs an error message, optionally including the location (file, line, function) where the error occurred.

Parameters
messageThe error message to log.
locationThe source location of the error (default: current location).

Implemented in IO::Console.

◆ operator=() [1/2]

Logger & IO::Logger::operator= ( const Logger & )
default
Here is the call graph for this function:

◆ operator=() [2/2]

Logger & IO::Logger::operator= ( Logger && )
default
Here is the call graph for this function:

◆ print()

virtual void IO::Logger::print ( std::string_view prefix,
std::string_view message )
pure virtual

Log a regular print message with a prefix.

Logs a general message with the specified prefix. Typically used for general informational messages.

Parameters
prefixA string prefix to prepend to the message.
messageThe message to log.

Implemented in IO::Console.

◆ raw_log()

virtual void IO::Logger::raw_log ( std::string_view message)
pure virtual

Log a raw message with no additional formatting.

Logs a raw message without any prefix or other enhancements.

Parameters
messageThe raw message to log.

Implemented in IO::Console.

◆ toggle_alert()

virtual void IO::Logger::toggle_alert ( )
pure virtualnoexcept

Toggle the alert logging behavior on or off.

Enables or disables the logging of alert messages.

Implemented in IO::Console.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggle_all()

virtual void IO::Logger::toggle_all ( )
pure virtualnoexcept

Toggle all logging types on or off.

Enables or disables all types of logging at once (debug, print, alert, error).

Implemented in IO::Console.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggle_debug()

virtual void IO::Logger::toggle_debug ( )
pure virtualnoexcept

Toggle the debug logging behavior on or off.

Enables or disables the logging of debug messages.

Implemented in IO::Console.

◆ toggle_error()

virtual void IO::Logger::toggle_error ( )
pure virtualnoexcept

Toggle the error logging behavior on or off.

Enables or disables the logging of error messages.

Implemented in IO::Console.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggle_print()

virtual void IO::Logger::toggle_print ( )
pure virtualnoexcept

Toggle the print logging behavior on or off.

Enables or disables the logging of print messages.

Implemented in IO::Console.

Here is the call graph for this function:
Here is the caller graph for this function:

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