[9838] More log filters and macro uses.

* LogFilter_Weather
* LogFilter_PeriodicAffects
* LogFilter_PlayerMoves
* LogFilter_SQLText
* LogFilter_AIAndMovegens
* LogFilter_PlayerStats
This commit is contained in:
VladimirMangos 2010-05-05 01:21:55 +04:00
parent e83aa1ba9d
commit 722135b326
89 changed files with 996 additions and 997 deletions

View file

@ -141,7 +141,7 @@ bool DatabaseMysql::Initialize(const char *infoString)
if (mMysql)
{
sLog.outDetail( "Connected to MySQL database at %s",
DETAIL_LOG( "Connected to MySQL database at %s",
host.c_str());
sLog.outString( "MySQL client library: %s", mysql_get_client_info());
sLog.outString( "MySQL server ver: %s ", mysql_get_server_info( mMysql));
@ -155,9 +155,9 @@ bool DatabaseMysql::Initialize(const char *infoString)
// autocommit is turned of during it.
// Setting it to on makes atomic updates work
if (!mysql_autocommit(mMysql, 1))
sLog.outDetail("AUTOCOMMIT SUCCESSFULLY SET TO 1");
DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 1");
else
sLog.outDetail("AUTOCOMMIT NOT SET TO 1");
DETAIL_LOG("AUTOCOMMIT NOT SET TO 1");
/*-------------------------------------*/
// set connection properties to UTF8 to properly handle locales for different
@ -184,9 +184,9 @@ bool DatabaseMysql::_Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD **p
{
// guarded block for thread-safe mySQL request
ACE_Guard<ACE_Thread_Mutex> query_connection_guard(mMutex);
#ifdef MANGOS_DEBUG
uint32 _s = getMSTime();
#endif
if(mysql_query(mMysql, sql))
{
sLog.outErrorDb( "SQL: %s", sql );
@ -195,9 +195,7 @@ bool DatabaseMysql::_Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD **p
}
else
{
#ifdef MANGOS_DEBUG
sLog.outDebug("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql );
#endif
DEBUG_FILTER_LOG(LOG_FILTER_SQL_TEXT, "[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql );
}
*pResult = mysql_store_result(mMysql);
@ -289,9 +287,8 @@ bool DatabaseMysql::DirectExecute(const char* sql)
// guarded block for thread-safe mySQL request
ACE_Guard<ACE_Thread_Mutex> query_connection_guard(mMutex);
#ifdef MANGOS_DEBUG
uint32 _s = getMSTime();
#endif
if(mysql_query(mMysql, sql))
{
sLog.outErrorDb("SQL: %s", sql);
@ -300,9 +297,7 @@ bool DatabaseMysql::DirectExecute(const char* sql)
}
else
{
#ifdef MANGOS_DEBUG
sLog.outDebug("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql );
#endif
DEBUG_FILTER_LOG(LOG_FILTER_SQL_TEXT, "[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql );
}
// end guarded block
}
@ -320,7 +315,7 @@ bool DatabaseMysql::_TransactionCmd(const char *sql)
}
else
{
DEBUG_LOG("SQL: %s", sql);
DEBUG_FILTER_LOG(LOG_FILTER_SQL_TEXT, "SQL: %s", sql);
}
return true;
}