From e07e20ffcaf6911d4dd47e0895fbdc52c5a52f05 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 20 Feb 2011 20:16:34 +0100 Subject: Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf. --- src/server/shared/Logging/Log.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/server/shared/Logging/Log.cpp') diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index dd66e3e0811..eaff7cbd8fa 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -168,16 +168,7 @@ void Log::Initialize() m_dbLogLevel = sConfig->GetIntDefault("DBLogLevel", LOGL_NORMAL); m_sqlDriverQueryLogging = sConfig->GetBoolDefault("SQLDriverQueryLogging", false); - m_logFilter = 0; - - if(sConfig->GetBoolDefault("LogFilter_TransportMoves", true)) - m_logFilter |= LOG_FILTER_TRANSPORT_MOVES; - if(sConfig->GetBoolDefault("LogFilter_CreatureMoves", true)) - m_logFilter |= LOG_FILTER_CREATURE_MOVES; - if(sConfig->GetBoolDefault("LogFilter_VisibilityChanges", true)) - m_logFilter |= LOG_FILTER_VISIBILITY_CHANGES; - if(sConfig->GetBoolDefault("LogFilter_AchievementUpdates", true)) - m_logFilter |= LOG_FILTER_ACHIEVEMENT_UPDATES; + m_DebugLogMask = DebugLogFilters(sConfig->GetIntDefault("DebugLogMask", LOG_FILTER_NONE)); // Char log settings m_charLog_Dump = sConfig->GetBoolDefault("CharLogDump", false); @@ -723,8 +714,11 @@ void Log::outDebugInLine(const char * str, ...) } } -void Log::outDebug(const char * str, ...) +void Log::outDebug(DebugLogFilters f, const char * str, ...) { + if (!(m_DebugLogMask & f)) + return; + if (!str) return; -- cgit v1.2.3