diff --git a/src/logging/Logger.cpp b/src/logging/Logger.cpp index ed0c894..2a675a2 100644 --- a/src/logging/Logger.cpp +++ b/src/logging/Logger.cpp @@ -11,6 +11,7 @@ namespace Feather::Logging Logger GlobalLogger; ChannelID LOG_GENERAL = REGISTER_LOGGING_CHANNEL("General"); + ChannelID LOG_LOGGING = REGISTER_LOGGING_CHANNEL("Logging"); // Since min and max are inclusive we have to add 1 here // This assumes max > min (they better be) @@ -84,10 +85,11 @@ namespace Feather::Logging ChannelID Logger::RegisterChannel(const char* name) { - Channel* channel = new Channel(name); if (m_channelCount >= MAX_LOGGING_CHANNEL_COUNT) { - // complain + Log_Msg( LOG_LOGGING, ERROR, "Cannot register new logging channel '%s' because the maximum of %d channels has been exceeded.", name, MAX_LOGGING_CHANNEL_COUNT ); + return LOG_GENERAL; } + Channel *channel = new Channel(name); m_channels[m_channelCount] = channel; int id = m_channelCount++; return id; @@ -118,6 +120,7 @@ static void InitPlatformConsole() DWORD mode = 0; if (GetConsoleMode(handle, &mode)) { + // To enable ANSI escape sequences on Windows 10 we need to set this flag mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; SetConsoleMode(handle, mode); }