2#ifndef LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_ENUMS_HPP_INCLUDED
3#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_ENUMS_HPP_INCLUDED
78 static const std::array<const char*, 6> data_str_0 = {
86 static const std::array<const char*, 6> data_str_1 = {
96 return data_str_0[
static_cast<size_t>(level)];
98 return data_str_1[
static_cast<size_t>(level)];
102 return data_str_0[
static_cast<size_t>(level)];
110 return std::string(
to_c_str(level, mode));
117 static const std::array<const char*, 16> ansi_codes = {
137 return ansi_codes[
static_cast<int>(color)];
144 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.
std::string to_string(LogLevel level, int mode=0)
Convert LogLevel to a std::string representation.
RotationNaming
Naming policy for rotated log files.
@ Sequence
Append a numeric sequence: YYYY-MM-DD.001.log.
@ TimestampMs
Append HHMMSSmmm timestamp: YYYY-MM-DD_HHMMSSmmm.log.
@ Timestamp
Append HHMMSS timestamp: YYYY-MM-DD_HHMMSS.log.
@ 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 get_log_level_color(LogLevel log_level)
Get the ANSI color code associated with a log level.
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.
@ DroppedLogCount
Number of log records dropped by the backend.
@ FailedExportCount
Number of failed export attempts reported by the backend.
@ LastFileName
The name of the last file written to.
@ LastFilePath
The full path of the last file written to.
TextColor
Text colors for console output.
CompressType
Supported compression algorithms for rotated files.
@ ZSTD
Compress using zstd.
@ NONE
Do not compress rotated files.
@ GZIP
Compress using gzip (zlib).
@ EXTERNAL_CMD
Use an external command for compression.
const char * to_c_str(LogLevel level, int mode=0)
Convert LogLevel to a C-style string representation.