diff --git a/inc/Logger.hpp b/inc/Logger.hpp index f1319550b87c36f945534012403d17d4df57dabc..f1ec6c95149e2044f35343d93de5186e459c3746 100644 --- a/inc/Logger.hpp +++ b/inc/Logger.hpp @@ -107,7 +107,7 @@ public: * * Each severity is tied to a number. The higher the number, the higher the severity. */ - enum LogLevel { + enum LogLevel : LogLevelType { trace = 32, ///< Very detailed information, useful for tracking the individual steps of an operation debug = 64, ///< General debugging information info = 96, ///< Noteworthy or periodical events @@ -121,9 +121,10 @@ public: /** * A class that defines a log message. * - * Instead of using this class, prefer one of the above macros - */ - struct LogEntry { + * Instead of using this class, prefer one of the above macros + * @internal + */ + struct LogEntry { String<LOGGER_MAX_MESSAGE_SIZE> message = ""; ///< The current log message itself, starting from a blank slate etl::format_spec format; ///< ETL's string format specification LogLevel level; ///< The log level of this message diff --git a/src/Platform/x86/Logger.cpp b/src/Platform/x86/Logger.cpp index ed4fe3a079c6328d63ce7e8f215d3e9587e8991a..57af7a38a79c215cedb0d10d295d3bef668f1133 100644 --- a/src/Platform/x86/Logger.cpp +++ b/src/Platform/x86/Logger.cpp @@ -44,11 +44,11 @@ void Logger::log(Logger::LogLevel level, String<LOGGER_MAX_MESSAGE_SIZE> & messa std::ostringstream ss; // A string stream to create the log message ss << "\033" "[0;90m" << std::put_time(&tm, "%FT%T%z") << "\033" "[0m "; // The date - ss << "[\033" "[1;" << colour << "m" << std::setfill(' ') << std::setw(7) << std::right - << name << std::setw(0) << "\033" "[0m] "; // The log level + ss << "[\033" "[1;" << colour << "m" << std::setfill(' ') << std::setw(7) << std::right // Ignore-MISRA + << name << std::setw(0) << "\033" "[0m] "; // The log level // Ignore-MISRA if (keepColour) { - ss << "\033" "[0;" << colour << "m"; + ss << "\033" "[0;" << colour << "m"; // Ignore-MISRA } ss << message.c_str(); // The message itself if (keepColour) { diff --git a/src/Platform/x86/Service.cpp b/src/Platform/x86/Service.cpp index c44acb96e53b0d2f96ddc4022c19b4934e375660..60786fc650c32da32cb98860886291537e378fce 100644 --- a/src/Platform/x86/Service.cpp +++ b/src/Platform/x86/Service.cpp @@ -13,7 +13,8 @@ void Service::storeMessage(Message& message) { // Just print it to the screen ss << "New " << ((message.packetType == Message::TM) ? "TM" : "TC") << "[" << std::hex - << static_cast<int>(message.serviceType) << "," << static_cast<int>(message.messageType) + << static_cast<int>(message.serviceType) << "," // Ignore-MISRA + << static_cast<int>(message.messageType) // Ignore-MISRA << "] message! "; for (unsigned int i = 0; i < message.dataSize; i++) {