|
HerrLog
v0.2
Header file logging library
|
A single header lightweight logging library.
Simply download the project and import herrlog.hh. Or run the below given curl command in your directory.
Herr Log supports the following log levels.
| Log Level | Use Case |
|---|---|
| Trace | Capture fine-grained details and trace specific actions, offering insights into the program's behavior (e.g., variable values, function calls). |
| Info | Report significant events, milestones, or key actions in the program's execution (e.g., program start, major processes). |
| Debug | Intended for temporary and detailed reporting during development or debugging phases to comprehend and analyze specific parts of the code. Use sparingly in production. |
| Warn | Report errors or potential areas where errors have not been handled gracefully. Does not terminate the program. |
| Error | Report critical errors requiring immediate attention. Results in program termination. |
| Fatal | Report critical errors, terminate the program, and generate a crash dump (abort). |
All these can be activated/deactivated independently by setting the style using Logger::set_type.
By default, the style is LogStyle::All, i.e. all log types are enabled. The output is directed to the console using anse colors and the datetime format is "%Y-%m-%d %H:%M:%S".
In place of log_file, any other stream can also be put.
For example, if only error and info messages are needed.
The default datetime format is Y-m-d H:M:S. These variables can then be used to specify a custom date time format.