diff options
author | megamage <none@none> | 2009-06-01 15:53:03 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-01 15:53:03 -0500 |
commit | 2c350bcb803ab386a3680227aa6e641e3ae8ad03 (patch) | |
tree | 1ea4bd25064fdce3e497531e67a7b0fd52194c2a /src/shared/Log.cpp | |
parent | 751665248146001f45c30924037bb200a2821d60 (diff) | |
parent | 16e0e9931edf21f837672cdc14f5a8298eba444e (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Log.cpp')
-rw-r--r-- | src/shared/Log.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp index d81594c9787..c90b96b291f 100644 --- a/src/shared/Log.cpp +++ b/src/shared/Log.cpp @@ -32,6 +32,7 @@ INSTANTIATE_SINGLETON_1( Log ); Log::Log() : raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), dberLogfile(NULL), chatLogfile(NULL), m_gmlog_per_account(false), m_colored(false) + , arenaLogFile(NULL) { Initialize(); } @@ -61,6 +62,10 @@ Log::~Log() if (chatLogfile != NULL) fclose(chatLogfile); chatLogfile = NULL; + + if (arenaLogFile != NULL) + fclose(arenaLogFile); + arenaLogFile = NULL; } void Log::SetLogLevel(char *Level) @@ -154,6 +159,7 @@ void Log::Initialize() dberLogfile = openLogFile("DBErrorLogFile",NULL,"a"); raLogfile = openLogFile("RaLogFile",NULL,"a"); chatLogfile = openLogFile("ChatLogFile","ChatLogTimestamp","a"); + arenaLogFile = openLogFile("ArenaLogFile",NULL,"a"); // Main log file settings m_logLevel = sConfig.GetIntDefault("LogLevel", LOGL_NORMAL); @@ -173,6 +179,7 @@ void Log::Initialize() // Char log settings m_charLog_Dump = sConfig.GetBoolDefault("CharLogDump", false); + } FILE* Log::openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode) @@ -491,6 +498,24 @@ void Log::outError( const char * err, ... ) fflush(stderr); } +void Log::outArena( const char * str, ... ) +{ + if( !str ) + return; + + if(arenaLogFile) + { + va_list ap; + outTimestamp(arenaLogFile); + va_start(ap, str); + vfprintf(arenaLogFile, str, ap); + fprintf(arenaLogFile, "\n" ); + va_end(ap); + fflush(arenaLogFile); + } + fflush(stdout); +} + void Log::outErrorDb( const char * err, ... ) { if( !err ) |