1#ifndef ARION_LOGGER_HPP
2#define ARION_LOGGER_HPP
10#include <arion/spdlog/spdlog.h>
77 static_cast<std::stringstream &
>(*this) << value;
82 using std::stringstream::operator<<;
108 std::shared_ptr<spdlog::logger> logger;
This class is responsible for managing logging in the Arion emulation framework.
Definition logger.hpp:87
static std::unique_ptr< Logger > initialize(std::weak_ptr< Arion > arion, LOG_LEVEL lvl=LOG_LEVEL::INFO)
LOG_LEVEL log_lvl
The current log level.
Definition logger.hpp:102
pid_t curr_pid
The process ID of the current process.
Definition logger.hpp:98
void info(std::string str)
void set_log_level(LOG_LEVEL lvl)
uint64_t id
The unique identifier for this logger instance.
Definition logger.hpp:96
Logger(std::weak_ptr< Arion > arion)
void error(std::string str)
LOG_LEVEL get_log_level()
pid_t curr_tid
The thread ID of the current thread.
Definition logger.hpp:100
static uint64_t curr_id
The unique identifier for this logger instance.
Definition logger.hpp:90
void debug(std::string str)
void refresh_prefix(bool force=false)
std::weak_ptr< Arion > arion
The Arion instance associated to this instance.
Definition logger.hpp:104
void warn(std::string str)
std::shared_ptr< void > logger
The spdlog logger instance.
Definition logger.hpp:111
static uint64_t gen_next_id()
Generates the next free logger ID.
void critical(std::string str)
void trace(std::string str)
static std::stack< uint64_t > free_logger_ids
A stack of free logger IDs that can be reused.
Definition logger.hpp:92
A stringstream extended class, which allows the use of LOG_COLOR colors for logging.
Definition logger.hpp:55
colorstream & operator<<(const T &value)
Definition logger.hpp:75
colorstream & operator<<(const LOG_COLOR &color)
Definition logger.hpp:62
#define ARION_EXPORT
Defines which symbols should be exported from the library.
Definition global_defs.hpp:13
Definition arch_x86-64.hpp:11
LOG_LEVEL
Identifies a logging level.
Definition global_defs.hpp:156
LOG_COLOR
These colors can be used for logging.
Definition logger.hpp:22
@ LIGHT_GRAY
Light gray.
Definition logger.hpp:31
@ DARK_MAGENTA
Dark magenta.
Definition logger.hpp:29
@ DARK_BLUE
Dark blue.
Definition logger.hpp:28
@ RED
Red.
Definition logger.hpp:33
@ ORANGE
Orange.
Definition logger.hpp:35
@ DARK_YELLOW
Dark yellow.
Definition logger.hpp:27
@ DARK_CYAN
Dark cyan.
Definition logger.hpp:30
@ DARK_RED
Dark red.
Definition logger.hpp:25
@ BLACK
Black.
Definition logger.hpp:24
@ DARK_GREEN
Dark green.
Definition logger.hpp:26
@ MAGENTA
Magenta.
Definition logger.hpp:37
@ WHITE
White.
Definition logger.hpp:39
@ DARK_GRAY
Dark gray.
Definition logger.hpp:32
@ GREEN
Green.
Definition logger.hpp:34
@ CYAN
Cyan.
Definition logger.hpp:38
@ DEFAULT
Default foreground color.
Definition logger.hpp:23
@ BLUE
Blue.
Definition logger.hpp:36
std::map< LOG_COLOR, std::string > arion_log_colors_str
A map identifying an ANSI color code given its associated Arion LOG_COLOR.
Definition logger.hpp:43