diff options
author | XTZGZoReX <none@none> | 2009-03-26 16:46:08 +0100 |
---|---|---|
committer | XTZGZoReX <none@none> | 2009-03-26 16:46:08 +0100 |
commit | 0952469d69536b00cb58167970d6cff646e7ccaf (patch) | |
tree | 1e02cb6e2cb49186c043d90a92d73310884f8df5 /src | |
parent | 0da5f826b8d46ff8249347c1386d347b3cc7d2df (diff) |
* Fix some conversion in DB logging.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/World.cpp | 2 | ||||
-rw-r--r-- | src/shared/Log.cpp | 9 | ||||
-rw-r--r-- | src/shared/Log.h | 24 |
3 files changed, 19 insertions, 16 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp index 22aa0eb9af7..e84a6cbaddc 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1722,7 +1722,7 @@ void World::Update(uint32 diff) uint32 maxClientsNum = sWorld.GetMaxActiveSessionCount(); m_timers[WUPDATE_CLEANDB].Reset(); - LoginDatabase.PExecute("DELETE FROM logs WHERE (time + %u) < %u;", + LoginDatabase.PExecute("DELETE FROM logs WHERE (time + %u) < "I64FMTD";", sWorld.getConfig(CONFIG_LOGDB_CLEARTIME), uint64(time(0))); } } diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp index e79ea12933d..2603069a461 100644 --- a/src/shared/Log.cpp +++ b/src/shared/Log.cpp @@ -91,12 +91,15 @@ void Log::SetDBLogLevel(char *Level) void Log::Initialize() { - /// Check whether we'll log GM commands/RA events/character outputs + /// Check whether we'll log GM commands/RA events/character outputs/chat stuffs m_dbChar = sConfig.GetBoolDefault("LogDB.Char", false); m_dbRA = sConfig.GetBoolDefault("LogDB.RA", false); m_dbGM = sConfig.GetBoolDefault("LogDB.GM", false); m_dbChat = sConfig.GetBoolDefault("LogDB.Chat", false); + /// Realm must be 0 by default + SetRealmID(0); + /// Common log files data m_logsDir = sConfig.GetStringDefault("LogsDir",""); if(!m_logsDir.empty()) @@ -337,9 +340,9 @@ std::string Log::GetTimestampStr() return std::string(buf); } -void Log::outDB( uint8 type, const char * str, ... ) +void Log::outDB( uint32 type, const char * str, ... ) { - if(!type) + if(type >= MAX_LOG_TYPES) return; if(!str) diff --git a/src/shared/Log.h b/src/shared/Log.h index 78261470174..6ef7f64289e 100644 --- a/src/shared/Log.h +++ b/src/shared/Log.h @@ -95,20 +95,20 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ZThr void SetColor(bool stdout_stream, ColorTypes color); void ResetColor(bool stdout_stream); - void outDB( uint8 type, const char * str, ... ) ATTR_PRINTF(3,4); - void outString( const char * str, ... ) ATTR_PRINTF(2,3); + void outDB( uint32 type, const char * str, ... ) ATTR_PRINTF(3,4); + void outString( const char * str, ... ) ATTR_PRINTF(2,3); void outString( ); - void outError( const char * err, ... ) ATTR_PRINTF(2,3); - void outCrash( const char * err, ... ) ATTR_PRINTF(2,3); - void outBasic( const char * str, ... ) ATTR_PRINTF(2,3); - void outDetail( const char * str, ... ) ATTR_PRINTF(2,3); - void outDebug( const char * str, ... ) ATTR_PRINTF(2,3); - void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3); - void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3); - void outChar( const char * str, ... ) ATTR_PRINTF(2,3); + void outError( const char * err, ... ) ATTR_PRINTF(2,3); + void outCrash( const char * err, ... ) ATTR_PRINTF(2,3); + void outBasic( const char * str, ... ) ATTR_PRINTF(2,3); + void outDetail( const char * str, ... ) ATTR_PRINTF(2,3); + void outDebug( const char * str, ... ) ATTR_PRINTF(2,3); + void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3); + void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3); + void outChar( const char * str, ... ) ATTR_PRINTF(2,3); void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3,4); - void outRemote( const char * str, ... ) ATTR_PRINTF(2,3); - void outChat( const char * str, ... ) ATTR_PRINTF(2,3); + void outRemote( const char * str, ... ) ATTR_PRINTF(2,3); + void outChat( const char * str, ... ) ATTR_PRINTF(2,3); void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); static void outTimestamp(FILE* file); |