*Minor cleanup in Log::outDB - by XTZGZoReX.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-07-28 23:45:03 +02:00
parent 6bb0ff8948
commit 06d0560f15
+5 -3
View File
@@ -353,14 +353,16 @@ std::string Log::GetTimestampStr()
void Log::outDB( LogTypes type, const char * str ) void Log::outDB( LogTypes type, const char * str )
{ {
if(!str || std::string(str).empty() || type >= MAX_LOG_TYPES) if (!str || type >= MAX_LOG_TYPES)
return; return;
std::string new_str(str); std::string new_str(str);
if (new_str.empty())
return;
LoginDatabase.escape_string(new_str); LoginDatabase.escape_string(new_str);
LoginDatabase.PExecute("INSERT INTO logs (time, realm, type, string) " LoginDatabase.PExecute("INSERT INTO logs (time, realm, type, string) "
"VALUES (" UI64FMTD ", %u, %u, '%s');", uint64(time(0)), realm, (uint32)type, new_str.c_str()); "VALUES (" UI64FMTD ", %u, %u, '%s');", uint64(time(0)), realm, type, new_str.c_str());
} }
void Log::outString( const char * str, ... ) void Log::outString( const char * str, ... )