diff --git a/src/ECS/Logger.cpp b/src/ECS/Logger.cpp index 865870d0..32816c0f 100644 --- a/src/ECS/Logger.cpp +++ b/src/ECS/Logger.cpp @@ -109,42 +109,43 @@ namespace Logger { { #ifdef __linux__ static std::map colors = { - {LogLevel::Fatal, "\033[31m"}, - {LogLevel::Error, "\033[33m"}, - {LogLevel::Warn, "\033[34m"}, - {LogLevel::Info, "\033[32m"}, - {LogLevel::Debug, "\033[38m"}, - {LogLevel::Trace, "\033[30m"}, + {LogLevel::Fatal, "\033[31m"}, + {LogLevel::Error, "\033[33m"}, + {LogLevel::Warn, "\033[34m"}, + {LogLevel::Info, "\033[32m"}, + {LogLevel::Debug, "\033[38m"}, + {LogLevel::Trace, "\033[30m"}, {LogLevel::MAXLOGLEVEL, "\033[0m" }, }; #elif __APPLE__ static std::map colors = { - {LogLevel::Fatal, "\033[31m"}, - {LogLevel::Error, "\033[33m"}, - {LogLevel::Warn, "\033[34m"}, - {LogLevel::Info, "\033[32m"}, - {LogLevel::Debug, "\033[38m"}, - {LogLevel::Trace, "\033[30m"}, + {LogLevel::Fatal, "\033[31m"}, + {LogLevel::Error, "\033[33m"}, + {LogLevel::Warn, "\033[34m"}, + {LogLevel::Info, "\033[32m"}, + {LogLevel::Debug, "\033[38m"}, + {LogLevel::Trace, "\033[30m"}, {LogLevel::MAXLOGLEVEL, "\033[0m" }, }; #else - static std::map colors = - { - {LogLevel::Fatal,""}, - {LogLevel::Error,""}, - {LogLevel::Warn, ""}, - {LogLevel::Info, ""}, - {LogLevel::Debug,""}, - {LogLevel::Trace,""}, - {LogLevel::MAXLOG""}, + static std::map colors = { + {LogLevel::Fatal, ""}, + {LogLevel::Error, ""}, + {LogLevel::Warn,""}, + {LogLevel::Info, ""}, + {LogLevel::Debug, ""}, + {LogLevel::Trace, ""}, + {LogLevel::MAXLOG ""}, }; #endif - auto const now = std::chrono::current_zone()->to_local(std::chrono::system_clock::now()); + auto const now = std::chrono::current_zone()->to_local( + std::chrono::system_clock::now()); std::string mes; auto it = _callbacks.find(levelT); - mes = std::format("{:%Y-%m-%d %H:%M:%S}", now) + " [" + level + "] " + message; + mes = std::format("{:%Y-%m-%d %H:%M:%S}", now) + " [" + level + "] " + + message; std::cerr << colors[levelT] << mes << colors[LogLevel::MAXLOGLEVEL] << std::endl; if (it != _callbacks.end()) { diff --git a/src/ECS/Logger.hpp b/src/ECS/Logger.hpp index ffb4ff65..ba56849a 100644 --- a/src/ECS/Logger.hpp +++ b/src/ECS/Logger.hpp @@ -13,13 +13,13 @@ namespace Logger { enum class LogLevel : int { - NOLOG = -1, - Fatal = 0, - Error = 1, - Warn = 2, - Info = 3, - Debug = 4, - Trace = 5, + NOLOG = -1, + Fatal = 0, + Error = 1, + Warn = 2, + Info = 3, + Debug = 4, + Trace = 5, MAXLOGLEVEL = 6, }; @@ -39,8 +39,9 @@ namespace Logger { * LogLevel::Error - `error` and `fatal` are displayed * LogLevel::Warn - `warn`, `error` and `fatal` are displayed * LogLevel::Info - `info`, `warn`, `error` and `fatal` are displayed - * LogLevel::Debug - `debug`, `info`, `warn`, `error` and `fatal` are displayed - * LogLevel::Trace - `trace`, `debug`, `info`, `warn`, `error` and `fatal` are displayed + * LogLevel::Debug - `debug`, `info`, `warn`, `error` and `fatal` are + * displayed LogLevel::Trace - `trace`, `debug`, `info`, `warn`, `error` and + * `fatal` are displayed * * Attention: * `debug` and `trace` will only do something in debug mode compilation. diff --git a/src/main_client.cpp b/src/main_client.cpp index 80d60e32..2f633bf8 100644 --- a/src/main_client.cpp +++ b/src/main_client.cpp @@ -5,8 +5,8 @@ ** main */ -#include "SceneManager.hpp" #include "Logger.hpp" +#include "SceneManager.hpp" int main() {