diff --git a/CMakeLists.txt b/CMakeLists.txt index e39033656..91eff4d10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,78 @@ SET(EQEMU_DEBUG_LEVEL 5 CACHE STRING "EQEmu debug level: 10 - More errors than you ever wanted to see" ) +SET(EQEMU_LOG_LEVEL_STATUS 2 CACHE STRING "EQEmu logging level for [Status]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +SET(EQEMU_LOG_LEVEL_NORMAL 3 CACHE STRING "EQEmu logging level for [Normal]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +SET(EQEMU_LOG_LEVEL_ERROR 2 CACHE STRING "EQEmu logging level for [Error]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +SET(EQEMU_LOG_LEVEL_DEBUG 3 CACHE STRING "EQEmu logging level for [Debug]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +SET(EQEMU_LOG_LEVEL_QUEST 2 CACHE STRING "EQEmu logging level for [Quest]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +SET(EQEMU_LOG_LEVEL_COMMANDS 1 CACHE STRING "EQEmu logging level for [Commands]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +SET(EQEMU_LOG_LEVEL_CRASH 3 CACHE STRING "EQEmu logging level for [Crash]: + 0 - Disabled + 1 - Ouput to File Enabled + 2 - Output to stdout Enabled + 3 - Output to File and stdout Enabled + 8 - Output to stderr Enabled + 9 - Output to File and stderr Enabled + 11 - Output to File, stdout and stderr Enabled" +) + +MARK_AS_ADVANCED(EQEMU_LOG_LEVEL_STATUS EQEMU_LOG_LEVEL_NORMAL EQEMU_LOG_LEVEL_ERROR EQEMU_LOG_LEVEL_DEBUG EQEMU_LOG_LEVEL_QUEST EQEMU_LOG_LEVEL_COMMANDS EQEMU_LOG_LEVEL_CRASH) + SET(EQEMU_STREAM_SEND_RATE 1048576 CACHE STRING "Advanced: Base amount of data stream can send before throttle.") SET(EQEMU_STREAM_DECAY_RATE 78642 CACHE STRING "Advanced: Base amount of data stream recovers per tic.") SET(EQEMU_STREAM_RETRANSMIT_TIMEOUT_MUL 3.0 CACHE STRING "Advanced: Multiplier on retransmit timeout.") @@ -182,6 +254,14 @@ ADD_DEFINITIONS(-DDECAYBASE=${EQEMU_STREAM_DECAY_RATE}) ADD_DEFINITIONS(-DRETRANSMIT_TIMEOUT_MULT=${EQEMU_STREAM_RETRANSMIT_TIMEOUT_MUL}) ADD_DEFINITIONS(-DRETRANSMIT_TIMEOUT_MAX=${EQEMU_STREAM_RETRANSMIT_TIMEOUT_MAX}) ADD_DEFINITIONS(-DAVERAGE_DELTA_MAX=${EQEMU_STREAM_AVERAGE_DELTA_MAX}) +ADD_DEFINITIONS(-DLOG_LEVEL_STATUS=${EQEMU_LOG_LEVEL_STATUS}) +ADD_DEFINITIONS(-DLOG_LEVEL_NORMAL=${EQEMU_LOG_LEVEL_NORMAL}) +ADD_DEFINITIONS(-DLOG_LEVEL_ERROR=${EQEMU_LOG_LEVEL_ERROR}) +ADD_DEFINITIONS(-DLOG_LEVEL_DEBUG=${EQEMU_LOG_LEVEL_DEBUG}) +ADD_DEFINITIONS(-DLOG_LEVEL_QUEST=${EQEMU_LOG_LEVEL_QUEST}) +ADD_DEFINITIONS(-DLOG_LEVEL_COMMANDS=${EQEMU_LOG_LEVEL_COMMANDS}) +ADD_DEFINITIONS(-DLOG_LEVEL_CRASH=${EQEMU_LOG_LEVEL_CRASH}) + IF(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS) ADD_DEFINITIONS(-DRETRANSMIT_ACKED_PACKETS=true) ELSE(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS) diff --git a/changelog.txt b/changelog.txt index 007a4153f..ff2dc1d1c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,7 +2,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 04/20/2014 == Secrets: Changed the functionality of EQDEBUG cmake flag. It now suppresses logs, but shows crashes in any scenario when set to 1. It will also now show crashes even if the log system is disabled. -KLS: Change to how signals work, signals with no delay will now be added to the signal queue. This addresses an odd timing issue where NPCs are in a state of life/death flux when a signal from event_death goes off. +KLS: Change to how quest signals work, signals with no delay will now be added to the signal queue. This addresses an odd timing issue where NPCs are in a state of life/death flux when a signal from event_death goes off. +KLS: Added cmake flags to define how logging behavior works for each different log type. == 04/18/2014 == Akkadius: Added #command error message suppression for those who don't want to see 'Command is not recognized' constantly diff --git a/common/debug.cpp b/common/debug.cpp index 632ca7b01..fa114a338 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -35,23 +35,20 @@ static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" }; EQEMuLog::EQEMuLog() { -// MOpen = new Mutex; -// MLog = new Mutex*[MaxLogID]; -// fp = new FILE*[MaxLogID]; -// pLogStatus = new uint8[MaxLogID]; for (int i=0; i