The Logger class provides logging functionality.
More...
#include <logging.hpp>
|
| 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.
|
|
|
void | log (const std::string &message) |
| Logs a message.
|
|
|
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.
|
|
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.
◆ 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] | name | The name of the logger. |
[in] | filename | The name of the log file. |
[in] | level | The logging level (default: Level::INFO). |
◆ ~Logger()
steppable::__internals::logging::Logger::~Logger |
( |
| ) |
|
◆ debug() [1/2]
void steppable::__internals::logging::Logger::debug |
( |
const std::string & | message | ) |
|
Logs a debug message.
- Parameters
-
[in] | message | The debug message to be logged. |
◆ 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] | message | The debug message to be logged. |
[in] | args | The additional arguments. |
◆ error() [1/2]
void steppable::__internals::logging::Logger::error |
( |
const std::string & | message | ) |
|
Logs an error message.
- Parameters
-
[in] | message | The error message to be logged. |
◆ 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] | message | The error message to be logged. |
[in] | args | The additional arguments. |
◆ info()
void steppable::__internals::logging::Logger::info |
( |
const std::string & | message | ) |
|
Logs an info message.
- Parameters
-
[in] | message | The info message to be logged. |
◆ log()
void steppable::__internals::logging::Logger::log |
( |
const std::string & | message | ) |
|
|
private |
Logs a message.
- Parameters
-
[in] | message | The message to be logged. |
- Note
- This function is private and should not be called directly.
◆ warning() [1/2]
void steppable::__internals::logging::Logger::warning |
( |
const std::string & | message | ) |
|
Logs a warning message.
- Parameters
-
[in] | message | The warning message to be logged. |
◆ 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] | message | The warning message to be logged. |
[in] | args | The additional arguments. |
◆ 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: