BioCMAMC-ST
IO::Console Class Referencefinal

Concrete class logging system through console. More...

#include <console.hpp>

Inheritance diagram for IO::Console:
[legend]
Collaboration diagram for IO::Console:
[legend]

Public Member Functions

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

Private Attributes

uint32_t flags
std::ostream & output
std::ostream & err_output

Detailed Description

Concrete class logging system through console.

This class defines the interface for logging messages of various types

Constructor & Destructor Documentation

◆ Console() [1/3]

IO::Console::Console ( )

CONSOLE.

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

◆ ~Console()

IO::Console::~Console ( )
overridedefault

◆ Console() [2/3]

IO::Console::Console ( const Console & )
delete
Here is the call graph for this function:

◆ Console() [3/3]

IO::Console::Console ( Console && )
delete
Here is the call graph for this function:

Member Function Documentation

◆ alert()

void IO::Console::alert ( std::string_view prefix,
std::string_view message )
finalvirtualnoexcept

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.

Implements IO::Logger.

Here is the caller graph for this function:

◆ debug()

void IO::Console::debug ( std::string_view message)
finalvirtualnoexcept

Log a debug message.

Logs a debug message with no prefix.

Parameters
messageThe message to log.

Implements IO::Logger.

◆ error()

void IO::Console::error ( std::string_view message,
std::source_location location = std::source_location::current() )
finalvirtualnoexcept

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).

Implements IO::Logger.

◆ operator=() [1/2]

Console & IO::Console::operator= ( Console && )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

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

◆ print()

void IO::Console::print ( std::string_view prefix,
std::string_view message )
finalvirtualnoexcept

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.

Implements IO::Logger.

◆ raw_log()

void IO::Console::raw_log ( std::string_view message)
finalvirtualnoexcept

Log a raw message with no additional formatting.

Logs a raw message without any prefix or other enhancements.

Parameters
messageThe raw message to log.

Implements IO::Logger.

Here is the caller graph for this function:

◆ toggle_alert()

void IO::Console::toggle_alert ( )
finalvirtualnoexcept

Toggle the alert logging behavior on or off.

Enables or disables the logging of alert messages.

Implements IO::Logger.

Here is the caller graph for this function:

◆ toggle_all()

void IO::Console::toggle_all ( )
finalvirtualnoexcept

Toggle all logging types on or off.

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

Implements IO::Logger.

Here is the caller graph for this function:

◆ toggle_debug()

void IO::Console::toggle_debug ( )
finalvirtualnoexcept

Toggle the debug logging behavior on or off.

Enables or disables the logging of debug messages.

Implements IO::Logger.

Here is the caller graph for this function:

◆ toggle_error()

void IO::Console::toggle_error ( )
finalvirtualnoexcept

Toggle the error logging behavior on or off.

Enables or disables the logging of error messages.

Implements IO::Logger.

Here is the caller graph for this function:

◆ toggle_print()

void IO::Console::toggle_print ( )
finalvirtualnoexcept

Toggle the print logging behavior on or off.

Enables or disables the logging of print messages.

Implements IO::Logger.

Here is the caller graph for this function:

Member Data Documentation

◆ err_output

std::ostream& IO::Console::err_output
private

◆ flags

uint32_t IO::Console::flags
private

◆ output

std::ostream& IO::Console::output
private

The documentation for this class was generated from the following files:
  • apps/libs/common/public/common/console.hpp
  • apps/libs/common/src/logger.cpp