This class is responsible for managing logging in the Arion emulation framework.
More...
#include <logger.hpp>
|
| static uint64_t | gen_next_id () |
| | Generates the next free logger ID.
|
| |
|
| uint64_t | id |
| | The unique identifier for this logger instance.
|
| |
| pid_t | curr_pid |
| | The process ID of the current process.
|
| |
| pid_t | curr_tid |
| | The thread ID of the current thread.
|
| |
| LOG_LEVEL | log_lvl |
| | The current log level.
|
| |
| std::weak_ptr< Arion > | arion |
| | The Arion instance associated to this instance.
|
| |
| std::shared_ptr< void > | logger |
| | The spdlog logger instance.
|
| |
|
| static uint64_t | curr_id |
| | The unique identifier for this logger instance.
|
| |
| static std::stack< uint64_t > | free_logger_ids |
| | A stack of free logger IDs that can be reused.
|
| |
This class is responsible for managing logging in the Arion emulation framework.
◆ Logger()
| arion::Logger::Logger |
( |
std::weak_ptr< Arion > |
arion | ) |
|
Builder for Logger instances.
- Parameters
-
| [in] | arion | The Arion instance associated with this instance. |
◆ critical()
| void arion::Logger::critical |
( |
std::string |
str | ) |
|
Logs a critical message.
- Parameters
-
| [in] | str | The message to log. |
◆ debug()
| void arion::Logger::debug |
( |
std::string |
str | ) |
|
Logs a debug message.
- Parameters
-
| [in] | str | The message to log. |
◆ error()
| void arion::Logger::error |
( |
std::string |
str | ) |
|
Logs an error message.
- Parameters
-
| [in] | str | The message to log. |
◆ gen_next_id()
| static uint64_t arion::Logger::gen_next_id |
( |
| ) |
|
|
staticprivate |
Generates the next free logger ID.
◆ get_log_level()
Retrieves the current log level.
- Returns
- The current log level.
◆ info()
| void arion::Logger::info |
( |
std::string |
str | ) |
|
Logs an info message.
- Parameters
-
| [in] | str | The message to log. |
◆ initialize()
Instanciates and initializes new Logger objects with some parameters.
- Parameters
-
| [in] | arion | The Arion instance associated with this instance. |
| [in] | lvl | The initial log level. |
- Returns
- A new Logger instance.
◆ refresh_prefix()
| void arion::Logger::refresh_prefix |
( |
bool |
force = false | ) |
|
|
private |
Refreshes the log prefix if needed.
- Parameters
-
| [in] | force | True if the prefix should be reloaded in all cases. |
◆ set_log_level()
| void arion::Logger::set_log_level |
( |
LOG_LEVEL |
lvl | ) |
|
Defines the log level.
- Parameters
-
| [in] | lvl | The new log level. |
◆ trace()
| void arion::Logger::trace |
( |
std::string |
str | ) |
|
Logs a trace message.
- Parameters
-
| [in] | str | The message to log. |
◆ warn()
| void arion::Logger::warn |
( |
std::string |
str | ) |
|
Logs a warning message.
- Parameters
-
| [in] | str | The message to log. |
◆ arion
| std::weak_ptr<Arion> arion::Logger::arion |
|
private |
The Arion instance associated to this instance.
◆ curr_id
| uint64_t arion::Logger::curr_id |
|
staticprivate |
The unique identifier for this logger instance.
◆ curr_pid
| pid_t arion::Logger::curr_pid |
|
private |
The process ID of the current process.
◆ curr_tid
| pid_t arion::Logger::curr_tid |
|
private |
The thread ID of the current thread.
◆ free_logger_ids
| std::stack<uint64_t> arion::Logger::free_logger_ids |
|
staticprivate |
A stack of free logger IDs that can be reused.
◆ id
| uint64_t arion::Logger::id |
|
private |
The unique identifier for this logger instance.
◆ log_lvl
◆ logger
| std::shared_ptr<void> arion::Logger::logger |
|
private |
The spdlog logger instance.
The documentation for this class was generated from the following file:
- /home/runner/work/Arion/Arion/include/arion/common/logger.hpp