Steppable 0.0.1
A CAS project written from scratch in C++
Loading...
Searching...
No Matches
steppable::__internals::logging::Logger Class Reference

The Logger class provides logging functionality. More...

#include <logging.hpp>

Public Member Functions

 Logger (const std::string &name, const std::string &filename, const Level level=Level::INFO)
 Constructs a Logger object.
 
 ~Logger ()
 Destroys the Logger object.
 
void error (const std::string &message)
 Logs an error message.
 
template<typename... Args>
void error (const std::string &message, Args... args)
 Logs an error message with additional arguments.
 
void warning (const std::string &message)
 Logs a warning message.
 
template<typename... Args>
void warning (const std::string &message, Args... args)
 Logs a warning message with additional arguments.
 
void info (const std::string &message)
 Logs an info message.
 
void debug (const std::string &message)
 Logs a debug message.
 
template<typename... Args>
void debug (const std::string &message, Args... args)
 Logs a debug message with additional arguments.
 

Private Member Functions

void log (const std::string &message)
 Logs a message.
 

Private Attributes

std::ofstream file
 The log file stream.
 
Level level = INFO
 The default logging level.
 
std::string name
 The name of the logger. This will be prepended to the log messages.
 

Detailed Description

The Logger class provides logging functionality.

The Logger class allows logging messages at different levels, such as error, warning, info, and debug. It writes the log messages to a specified log file.

Constructor & Destructor Documentation

◆ Logger()

steppable::__internals::logging::Logger::Logger ( const std::string & name,
const std::string & filename,
const Level level = Level::INFO )

Constructs a Logger object.

Parameters
[in]nameThe name of the logger.
[in]filenameThe name of the log file.
[in]levelThe logging level (default: Level::INFO).
Here is the call graph for this function:

◆ ~Logger()

steppable::__internals::logging::Logger::~Logger ( )

Destroys the Logger object.

Member Function Documentation

◆ debug() [1/2]

void steppable::__internals::logging::Logger::debug ( const std::string & message)

Logs a debug message.

Parameters
[in]messageThe debug message to be logged.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug() [2/2]

template<typename... Args>
void steppable::__internals::logging::Logger::debug ( const std::string & message,
Args... args )
inline

Logs a debug message with additional arguments.

Parameters
[in]messageThe debug message to be logged.
[in]argsThe additional arguments.
Here is the call graph for this function:

◆ error() [1/2]

void steppable::__internals::logging::Logger::error ( const std::string & message)

Logs an error message.

Parameters
[in]messageThe error message to be logged.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ error() [2/2]

template<typename... Args>
void steppable::__internals::logging::Logger::error ( const std::string & message,
Args... args )
inline

Logs an error message with additional arguments.

Parameters
[in]messageThe error message to be logged.
[in]argsThe additional arguments.
Here is the call graph for this function:

◆ info()

void steppable::__internals::logging::Logger::info ( const std::string & message)

Logs an info message.

Parameters
[in]messageThe info message to be logged.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log()

void steppable::__internals::logging::Logger::log ( const std::string & message)
private

Logs a message.

Parameters
[in]messageThe message to be logged.
Note
This function is private and should not be called directly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ warning() [1/2]

void steppable::__internals::logging::Logger::warning ( const std::string & message)

Logs a warning message.

Parameters
[in]messageThe warning message to be logged.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ warning() [2/2]

template<typename... Args>
void steppable::__internals::logging::Logger::warning ( const std::string & message,
Args... args )
inline

Logs a warning message with additional arguments.

Parameters
[in]messageThe warning message to be logged.
[in]argsThe additional arguments.
Here is the call graph for this function:

Member Data Documentation

◆ file

std::ofstream steppable::__internals::logging::Logger::file
private

The log file stream.

Warning
Don't write to this directly. Use the log() / warning()... functions instead.

◆ level

Level steppable::__internals::logging::Logger::level = INFO
private

The default logging level.

◆ name

std::string steppable::__internals::logging::Logger::name
private

The name of the logger. This will be prepended to the log messages.


The documentation for this class was generated from the following files:
Untitled