![]() |
Limo
A simple mod manager
|
Header for the Log namespace. More...
#include <filesystem>
#include <functional>
#include <string>
Go to the source code of this file.
Namespaces | |
namespace | Log |
Contains functions for logging. | |
Enumerations | |
enum | Log::LogLevel { LOG_ERROR = 0 , LOG_WARNING = 1 , LOG_INFO = 2 , LOG_DEBUG = 3 } |
Represents the importance of a log message. | |
Functions | |
void | Log::init (std::filesystem::path log_dir_path="") |
init Initializes the logger by setting the current log_file_path and renaming or deleting old log files if needed. | |
void | Log::debug (const std::string &message, int target_printer=0) |
Prints the current time and date followed by a debug message. | |
void | Log::info (const std::string &message, int target_printer=0) |
Prints the current time and date followed by an info message. | |
void | Log::warning (const std::string &message, int target_printer=0) |
Prints the current time and date followed by a warning message. | |
void | Log::error (const std::string &message, int target_printer=0) |
Prints the current time and date followed by an error message. | |
void | Log::log (LogLevel level, const std::string &message, int target_printer=0) |
Calls the appropriate logging function for the given log level with the given message. | |
Variables | |
LogLevel | Log::log_level = LOG_INFO |
Current log level. Messages with a log level less important than this will be ignored. | |
std::vector< std::function< void(std::string, LogLevel)> > | Log::log_printers |
Callback function used to output log messages. | |
std::filesystem::path | Log::log_dir = "" |
Directory to which log files should be written. Empty string means no log files. | |
std::filesystem::path | Log::log_file_path = "" |
Path to a log file. If this is != "" and exists, the log will be appended to that file. | |
int | Log::num_log_files = 10 |
Numberof log files to keep. One file is written per init() call. | |
Header for the Log namespace.