![]() |
LogIt++
|
The primary namespace for the LogIt++ library. More...
Namespaces | |
| namespace | detail |
Classes | |
| class | ConsoleLogger |
| Outputs log messages to the console with optional ANSI color support. More... | |
| class | FileLogger |
| Logs messages to files with date-based rotation and automatic deletion of old logs. More... | |
| struct | FormatInstruction |
| Structure to store log formatting instructions. More... | |
| interface | ILogFormatter |
| Interface for formatting log records. More... | |
| interface | ILogger |
| Interface for loggers that handle log message output. More... | |
| class | Logger |
| Singleton class managing multiple loggers and formatters. More... | |
| struct | LogRecord |
| Stores log metadata and content. More... | |
| class | LogStream |
A stream-based logger that collects log messages using the << operator. More... | |
| struct | PathComponents |
| Structure to hold the root and components of a path. More... | |
| class | PatternCompiler |
| Compiler for log formatting patterns. More... | |
| class | SimpleLogFormatter |
| A simple log formatter that formats log messages based on a user-defined pattern. More... | |
| class | UniqueFileLogger |
| Writes each log message to a unique file with automatic cleanup. More... | |
| struct | VariableValue |
| Structure for storing values of various types, including enumerations. More... | |
Typedefs | |
| using | crev_it_t = std::string::const_reverse_iterator |
Enumerations | |
| enum class | LogLevel { LOG_LVL_TRACE , LOG_LVL_DEBUG , LOG_LVL_INFO , LOG_LVL_WARN , LOG_LVL_ERROR , LOG_LVL_FATAL } |
| Logging levels. More... | |
| enum class | TextColor { Black , DarkRed , DarkGreen , DarkYellow , DarkBlue , DarkMagenta , DarkCyan , LightGray , DarkGray , Red , Green , Yellow , Blue , Magenta , Cyan , White } |
| Text colors for console output. More... | |
| enum class | LoggerParam { LastFileName , LastFilePath , LastLogTimestamp , TimeSinceLastLog } |
| Enumeration for different logger parameters that can be retrieved. More... | |
Functions | |
| const char * | to_c_str (LogLevel level, int mode=0) |
| Convert LogLevel to a C-style string representation. | |
| std::string | to_string (LogLevel level, int mode=0) |
| Convert LogLevel to a std::string representation. | |
| const char * | to_c_str (TextColor color) |
| Convert TextColor to a C-style string (ANSI escape codes). | |
| std::string | to_string (TextColor color) |
| Convert TextColor to a std::string (ANSI escape codes). | |
| std::string | get_log_level_color (LogLevel log_level) |
| Get the ANSI color code associated with a log level. | |
| void | test_log_depth_3 () |
| Logs test messages to verify path shortening at depth level 3. | |
| void | test_log_depth_2 () |
| Logs test messages to verify path shortening at depth level 2. | |
| void | test_log_depth_1 () |
| Logs test messages to verify path shortening at depth level 1. | |
| std::vector< VariableValue > | args_to_array (std::vector< std::string >::const_iterator) |
| Base case of recursion for argument conversion — when there are no more arguments. | |
| template<typename T, typename... Ts> | |
| std::vector< VariableValue > | args_to_array (std::vector< std::string >::const_iterator name_iter, const T &first_arg, const Ts &... args) |
| Recursive function to convert arguments into an array of tuples (name, value). | |
| bool | is_closing_template (crev_it_t left_it, crev_it_t right_it) |
| Checks if the '>' character is the closing of a template argument list. | |
| std::vector< std::string > | split_arguments (const std::string &all_names) |
| Splits a string of argument names into individual names, ignoring nested templates, parentheses, and quotes. | |
| std::string | format (const char *fmt,...) |
| Formats a string according to the specified format. | |
| std::string | get_exec_dir () |
| Retrieves the directory of the executable file. | |
| std::vector< std::string > | get_list_files (const std::string &path) |
| Recursively retrieves a list of all files in a directory. | |
| std::string | get_file_name (const std::string &file_path) |
| Extracts the file name from a full file path. | |
| PathComponents | split_path (const std::string &path) |
| Splits a path into its root and components. | |
| std::string | make_relative (const std::string &file_path, const std::string &base_path) |
| Computes the relative path from base_path to file_path. | |
| bool | is_file (const std::string &path) |
| Checks if a path represents a file (by checking for an extension). | |
| void | create_directories (const std::string &path) |
| Creates directories recursively for the given path. | |
| template<typename EnumType> | |
| std::string | enum_to_string (EnumType value) |
| Helper function to convert an enumeration to a string. | |
| template<> | |
| std::string | enum_to_string (COLORS value) |
The primary namespace for the LogIt++ library.
| using logit::crev_it_t = std::string::const_reverse_iterator |
Definition at line 39 of file argument_utils.hpp.
|
strong |
|
strong |
|
strong |
| std::vector< VariableValue > logit::args_to_array | ( | std::vector< std::string >::const_iterator | name_iter, |
| const T & | first_arg, | ||
| const Ts &... | args ) |
Recursive function to convert arguments into an array of tuples (name, value).
| T | Type of the first argument. |
| Ts | Types of the remaining arguments. |
| name_iter | Iterator for the argument name list. |
| first_arg | The first argument. |
| args | The remaining arguments. |
Definition at line 28 of file argument_utils.hpp.
|
inline |
Base case of recursion for argument conversion — when there are no more arguments.
| name_iter | Iterator for the argument name list. |
Definition at line 16 of file argument_utils.hpp.
| void logit::create_directories | ( | const std::string & | path | ) |
Creates directories recursively for the given path.
| path | The directory path to create. |
| std::runtime_error | if the directories cannot be created. |
Definition at line 393 of file path_utils.hpp.
| std::string logit::enum_to_string | ( | COLORS | value | ) |
Definition at line 37 of file example_logit_basic.cpp.
| std::string logit::enum_to_string | ( | EnumType | value | ) |
Helper function to convert an enumeration to a string.
| EnumType | The enumeration type. |
| value | The enumeration value. |
Definition at line 31 of file VariableValue.hpp.
|
inline |
Formats a string according to the specified format.
This function formats a string using either the custom implementation based on vsnprintf) or the fmt library, depending on whether the macro LOGIT_USE_FMT_LIB is defined.
| fmt | The format string (similar to printf format). |
| ... | A variable number of arguments matching the format string. |
Definition at line 28 of file format.hpp.
| std::string logit::get_exec_dir | ( | ) |
Retrieves the directory of the executable file.
Definition at line 71 of file path_utils.hpp.
| std::string logit::get_file_name | ( | const std::string & | file_path | ) |
Extracts the file name from a full file path.
| file_path | The full file path as a string. |
Definition at line 225 of file path_utils.hpp.
| std::vector< std::string > logit::get_list_files | ( | const std::string & | path | ) |
Recursively retrieves a list of all files in a directory.
| path | The directory path to search (UTF-8 encoded). |
Definition at line 140 of file path_utils.hpp.
|
inline |
Checks if the '>' character is the closing of a template argument list.
| left_it | Iterator pointing to the '>' character. |
| right_it | Iterator pointing to the end of the string. |
Definition at line 45 of file argument_utils.hpp.
|
inline |
Checks if a path represents a file (by checking for an extension).
| path | The path to check. |
Definition at line 384 of file path_utils.hpp.
| std::string logit::make_relative | ( | const std::string & | file_path, |
| const std::string & | base_path ) |
Computes the relative path from base_path to file_path.
| file_path | The target file path. |
| base_path | The base path from which to compute the relative path. |
Definition at line 330 of file path_utils.hpp.
|
inline |
Splits a string of argument names into individual names, ignoring nested templates, parentheses, and quotes.
| all_names | The string containing all argument names. |
Definition at line 63 of file argument_utils.hpp.
| PathComponents logit::split_path | ( | const std::string & | path | ) |
Splits a path into its root and components.
| path | The path to split. |
Definition at line 286 of file path_utils.hpp.
| void logit::test_log_depth_1 | ( | ) |
Logs test messages to verify path shortening at depth level 1.
Definition at line 11 of file test_log_depth_1.hpp.
| void logit::test_log_depth_2 | ( | ) |
Logs test messages to verify path shortening at depth level 2.
Definition at line 11 of file test_log_depth_2.hpp.
| void logit::test_log_depth_3 | ( | ) |
Logs test messages to verify path shortening at depth level 3.
Definition at line 11 of file test_log_depth_3.hpp.
|
inline |
|
inline |
|
inline |