diff --git a/rwengine/src/core/Logger.cpp b/rwengine/src/core/Logger.cpp index 70d27fe8..4b44f6c9 100644 --- a/rwengine/src/core/Logger.cpp +++ b/rwengine/src/core/Logger.cpp @@ -38,12 +38,7 @@ void Logger::verbose(const std::string& component, const std::string& message) { log(component, Logger::Verbose, message); } -std::map severityStr{{Logger::Error, 'E'}, - {Logger::Warning, 'W'}, - {Logger::Info, 'I'}, - {Logger::Verbose, 'V'}}; - void StdOutReceiver::messageReceived(const Logger::LogMessage& message) { - std::cout << severityStr[message.severity] << " [" << message.component - << "] " << message.message << '\n'; + std::cout << Logger::messageSeverityName[message.severity] << " [" + << message.component << "] " << message.message << '\n'; } diff --git a/rwengine/src/core/Logger.hpp b/rwengine/src/core/Logger.hpp index b18b5294..e75c0ced 100644 --- a/rwengine/src/core/Logger.hpp +++ b/rwengine/src/core/Logger.hpp @@ -1,6 +1,7 @@ #ifndef _RWENGINE_LOGGER_HPP_ #define _RWENGINE_LOGGER_HPP_ +#include #include #include #include @@ -13,7 +14,8 @@ */ class Logger { public: - enum MessageSeverity { Verbose, Info, Warning, Error }; + enum MessageSeverity { Verbose = 0, Info, Warning, Error}; + static constexpr std::array messageSeverityName{{'V', 'I', 'W', 'E'}}; struct LogMessage { /// The component that produced the message