2#ifndef _LOGIT_ENUMS_HPP_INCLUDED
3#define _LOGIT_ENUMS_HPP_INCLUDED
58 static const std::array<const char*, 6> data_str_0 = {
66 static const std::array<const char*, 6> data_str_1 = {
76 return data_str_0[
static_cast<size_t>(level)];
78 return data_str_1[
static_cast<size_t>(level)];
82 return data_str_0[
static_cast<size_t>(level)];
90 return std::string(
to_c_str(level, mode));
97 static const std::array<const char*, 16> ansi_codes = {
117 return ansi_codes[
static_cast<int>(color)];
125 return std::string(
to_c_str(color));
#define LOGIT_COLOR_DEBUG
#define LOGIT_COLOR_DEFAULT
#define LOGIT_COLOR_TRACE
#define LOGIT_COLOR_ERROR
#define LOGIT_COLOR_FATAL
The primary namespace for the LogIt++ library.
const char * to_c_str(const LogLevel &level, const int &mode=0)
Convert LogLevel to a C-style string representation.
@ LOG_LVL_TRACE
Trace level logging.
@ LOG_LVL_ERROR
Error level logging.
@ LOG_LVL_INFO
Information level logging.
@ LOG_LVL_FATAL
Fatal level logging.
@ LOG_LVL_DEBUG
Debug level logging.
@ LOG_LVL_WARN
Warning level logging.
std::string to_string(const LogLevel &level, const int &mode=0)
Convert LogLevel to a std::string representation.
LoggerParam
Enumeration for different logger parameters that can be retrieved.
@ TimeSinceLastLog
The time elapsed since the last log in seconds.
@ LastLogTimestamp
The timestamp of the last log.
@ LastFileName
The name of the last file written to.
@ LastFilePath
The full path of the last file written to.
std::string get_log_level_color(const LogLevel &log_level)
Get the ANSI color code associated with a log level.
TextColor
Text colors for console output.