|
Logger v1.0.0
Custom cli console for creating commands executable at runtime
|
Log manages logging with levels and timestamps. More...
#include <logger.hpp>
Public Types | |
| enum class | LogLevel { info = 0x01 , warning = 0x02 , error = 0x04 , debug = 0x08 , memory = 0x10 } |
| Enum specifying the log level. | |
Public Member Functions | |
| void | operator() (LogLevel level, std::string text) |
| Prints out a log with a set log level. | |
| void | operator() (std::string text) |
| Prints out a log with a default log level of info. | |
| void | SetLevel (short log_level) |
| Sets the levels that are supposed to be displayed. | |
Log manages logging with levels and timestamps.
Log should not be created by the user, the library exposes it as in inline variable log. It is responsible for filtering logs based on their level and creating threads that safely put logs on the screen.
| void lg::Log::operator() | ( | LogLevel | level, |
| std::string | text | ||
| ) |
Prints out a log with a set log level.
Firstly checks if the log level is supposed to be printed, then to avoid freezing the main thread creates a new one to print the log message.
| level | log level to print on |
| text | log message |

| void lg::Log::operator() | ( | std::string | text | ) |
Prints out a log with a default log level of info.
Firstly checks if the log level is supposed to be printed, then to avoid freezing the main thread creates a new one to print the log message.
| text | log message |

| void lg::Log::SetLevel | ( | short | log_level | ) |
Sets the levels that are supposed to be displayed.
By default thats all levels, set the levels from enum class lg::Log::LogLevel, casting them to short and or'ing them with |
| log_level | log levels to show |