Class for logging.
More...
#include <Logger.hpp>
|
| static void | init () |
| | Initialize the logger.
|
| |
| template<typename Func > |
| static void | logExecutionTime (const std::string &message, Func &&func) |
| | Log the execution time of a function.
|
| |
| static void | log (const std::string &message, const LogLevel &logLevel) |
| | Log a message with a specific log level.
|
| |
Class for logging.
Definition at line 28 of file Logger.hpp.
◆ ColorIndex
| Enumerator |
|---|
| COLOR_ERROR | |
| COLOR_INFO | |
| COLOR_WARNING | |
| COLOR_RESET | |
Definition at line 80 of file Logger.hpp.
◆ Logger() [1/3]
| utl::Logger::Logger |
( |
const Logger & | | ) |
|
|
delete |
◆ Logger() [2/3]
| utl::Logger::Logger |
( |
Logger && | | ) |
|
|
delete |
◆ Logger() [3/3]
◆ ~Logger()
◆ formatLogMessage()
| static std::string utl::Logger::formatLogMessage |
( |
LogLevel | level, |
|
|
const std::string & | message ) |
|
inlinestaticnodiscardprivate |
◆ getColorForDuration()
| static const char * utl::Logger::getColorForDuration |
( |
const float | duration | ) |
|
|
inlinestaticnodiscardprivate |
◆ init()
| void utl::Logger::init |
( |
| ) |
|
|
static |
Initialize the logger.
Definition at line 7 of file logger.cpp.
Referenced by main().
◆ log()
| static void utl::Logger::log |
( |
const std::string & | message, |
|
|
const LogLevel & | logLevel ) |
|
inlinestatic |
Log a message with a specific log level.
- Parameters
-
| message | Message to be logged |
| logLevel | Log level of the message |
Definition at line 71 of file Logger.hpp.
References COLOR_INFO, COLOR_RESET, COLOR_WARNING, formatLogMessage(), utl::INFO, LOG_LEVEL_COLOR, and to_underlying().
Referenced by cae::Application::Application(), cae::GLFW::create(), cae::Engine::Engine(), loadPlugins(), main(), cae::Application::parseEngineConf(), printFps(), cae::GLFW::setIcon(), cae::Application::setupEngine(), and cae::Engine::stop().
◆ logExecutionTime()
template<typename Func >
| static void utl::Logger::logExecutionTime |
( |
const std::string & | message, |
|
|
Func && | func ) |
|
inlinestatic |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ to_underlying()
template<typename E >
| static constexpr auto utl::Logger::to_underlying |
( |
E | e | ) |
|
|
inlinestaticconstexprprivatenoexcept |
◆ LOG_LEVEL_COLOR
| std::array<const char *, 4> utl::Logger::LOG_LEVEL_COLOR |
|
staticconstexprprivate |
◆ LOG_LEVEL_STRING
| std::array<const char *, 2> utl::Logger::LOG_LEVEL_STRING = {"INFO", "WARNING"} |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: