aboutsummaryrefslogtreecommitdiff
path: root/src/game/WorldLog.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-25 08:59:18 -0500
committermegamage <none@none>2009-04-25 08:59:18 -0500
commit28359b3ea8ad83316f3c411cebbd4c7e9722ce2e (patch)
tree51446079ae1e90d9af33be2231f11c288fd7bffc /src/game/WorldLog.cpp
parenta72f23f56b1f2175d1062210dc2cb097bc412deb (diff)
*Fix the format of world log.
--HG-- branch : trunk
Diffstat (limited to 'src/game/WorldLog.cpp')
-rw-r--r--src/game/WorldLog.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/game/WorldLog.cpp b/src/game/WorldLog.cpp
index d5bd3d0d181..52eb1e8b59c 100644
--- a/src/game/WorldLog.cpp
+++ b/src/game/WorldLog.cpp
@@ -65,6 +65,34 @@ void WorldLog::Initialize()
m_dbWorld = sConfig.GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled
}
+void WorldLog::outTimestampLog(char const *fmt, ...)
+{
+ if( LogWorld() )
+ {
+ Guard guard(*this);
+ ASSERT(i_file);
+
+ Log::outTimestamp(i_file);
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(i_file, fmt, args);
+ //fprintf(i_file, "\n" );
+ va_end(args);
+
+ fflush(i_file);
+ }
+
+ if (sLog.GetLogDB() && m_dbWorld)
+ {
+ va_list ap2;
+ va_start(ap2, fmt);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, fmt, ap2);
+ sLog.outDB(LOG_TYPE_WORLD, nnew_str);
+ va_end(ap2);
+ }
+}
+
void WorldLog::outLog(char const *fmt, ...)
{
if( LogWorld() )
@@ -75,7 +103,7 @@ void WorldLog::outLog(char const *fmt, ...)
va_list args;
va_start(args, fmt);
vfprintf(i_file, fmt, args);
- fprintf(i_file, "\n" );
+ //fprintf(i_file, "\n" );
va_end(args);
fflush(i_file);