diff --git a/CMakeLists.txt b/CMakeLists.txt index d49247268..0c43bd571 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,15 @@ SET(EQEMU_DEBUG_LEVEL 5 CACHE STRING "EQEmu debug level: #Bots are a compile time option so on/off OPTION(EQEMU_ENABLE_BOTS "Enable Bots" OFF) + +#Disable entire _mlog system (excludes trade/command logs) +OPTION(DISABLE_LOGSYS "Enable Logging INI System" OFF) + +#Disable entire _mlog system (excludes trade/command logs) +OPTION(DISABLE_LOGSYS "Enable Logging INI System" OFF) +#Enable GM Command log system +OPTION(COMMANDS_LOGGING "Enable GM Command logs" ON) + IF(EQEMU_ENABLE_BOTS) ADD_DEFINITIONS(-DBOTS) ENDIF(EQEMU_ENABLE_BOTS) diff --git a/common/MiscFunctions.h b/common/MiscFunctions.h index 98730c2d2..2117773f6 100644 --- a/common/MiscFunctions.h +++ b/common/MiscFunctions.h @@ -42,7 +42,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - LogFile->write(EQEMuLog::Debug, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + _log(NET__ERROR, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/features.h b/common/features.h index ca233248c..3047475e1 100644 --- a/common/features.h +++ b/common/features.h @@ -105,9 +105,6 @@ Zone extensions and features //uncomment to allow perl commands to override compiled commands #define COMMANDS_PERL_OVERRIDE -//enable logging of commands used -#define COMMANDS_LOGGING - //only log commands which require this minimum status or more #define COMMANDS_LOGGING_MIN_STATUS 1 diff --git a/common/logsys.h b/common/logsys.h index 3f9da4111..3933e7062 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -120,7 +120,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #endif #endif //!DISABLE_LOGSYS - +#ifndef DISABLE_LOGSYS /* these are macros which do not use ..., and work for anybody */ #define _hex( type, data, len) \ do { \ @@ -140,6 +140,12 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); log_raw_packet(type, seq, packet); \ } \ } while(false) + +#else + #define _hex( type, data, len) {} + #define _pkt( type, packet) {} + #define _raw( type, seq, packet) {} +#endif //!DISABLE_LOGSYS #ifdef ZONE class Mob; extern void log_hex_mob(LogType type, Mob *who, const char *data, uint32 length);