From 5abdafc6145f18b11612e814432e868a92b12d3f Mon Sep 17 00:00:00 2001 From: DankParrot Date: Tue, 28 Jul 2020 21:37:22 -0700 Subject: [PATCH] Logging system cleanup --- src/logging/Logger.cpp | 1 - src/logging/Logger.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/logging/Logger.cpp b/src/logging/Logger.cpp index 667185d..ed0c894 100644 --- a/src/logging/Logger.cpp +++ b/src/logging/Logger.cpp @@ -90,7 +90,6 @@ namespace Feather::Logging } m_channels[m_channelCount] = channel; int id = m_channelCount++; - printf("Registered channel %d '%s'\n", id, name); return id; } } diff --git a/src/logging/Logger.h b/src/logging/Logger.h index 2228894..08b363c 100644 --- a/src/logging/Logger.h +++ b/src/logging/Logger.h @@ -64,10 +64,20 @@ namespace Feather::Logging #define REGISTER_LOGGING_CHANNEL(Name) Feather::Logging::GlobalLogger.RegisterChannel(Name); +// Logs a message, specifying a channel and log level #define Log_Msg(_Channel, _Level, _Message, ...) Feather::Logging::GlobalLogger.LogDirect(Feather::Logging::_Channel, Feather::Logging::Level::_Level, _Message, ##__VA_ARGS__) +// Logs a general message for end-users #define Log_Info(Message, ...) Log_Msg(LOG_GENERAL, INFO, Message, ##__VA_ARGS__) + +// Logs a potential problem of note #define Log_Warn(Message, ...) Log_Msg(LOG_GENERAL, WARNING, Message, ##__VA_ARGS__) + +// Logs a serious problem #define Log_Error(Message, ...) Log_Msg(LOG_GENERAL, ERROR, Message, ##__VA_ARGS__) + +// Logs debug information for developers #define Log_Debug(Message, ...) Log_Msg(LOG_GENERAL, DEBUG, Message, ##__VA_ARGS__) + +// Logs fine grained debug information #define Log_Trace(Message, ...) Log_Msg(LOG_GENERAL, TRACE, Message, ##__VA_ARGS__)