mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9836] Make log output code more consistent for diff build modes.
* Make possible have debug output if build in release mode. * But preserver current optimization in avoid debug output args calculation if debug ouput disabled if done using DEBUG_LOG * Implement in same way BASIC_LOG, DETAIL_LOG. Recommended use its instead explicit access to sLog * Use variadic macros for DEBUG_LOG and other new defines. All supported VS/GCC have its support as C++ extension. * Add DEBUG_FILTER_LOG and semilar defines for filered log output and use its. * Also move recent added debug output for transport events under LOG_FILTER_TRANSPORT_MOVES
This commit is contained in:
parent
6726a08b48
commit
6dec6c8a9f
12 changed files with 168 additions and 179 deletions
|
|
@ -186,7 +186,7 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
else if(_player->IsInWorld())
|
||||
{
|
||||
(this->*opHandle.handler)(*packet);
|
||||
if (sLog.IsOutDebug() && packet->rpos() < packet->wpos())
|
||||
if (packet->rpos() < packet->wpos() && sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
||||
LogUnprocessedTail(packet);
|
||||
}
|
||||
// lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
|
||||
|
|
@ -200,7 +200,7 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
{
|
||||
// not expected _player or must checked in packet hanlder
|
||||
(this->*opHandle.handler)(*packet);
|
||||
if (sLog.IsOutDebug() && packet->rpos() < packet->wpos())
|
||||
if (packet->rpos() < packet->wpos() && sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
||||
LogUnprocessedTail(packet);
|
||||
}
|
||||
break;
|
||||
|
|
@ -212,7 +212,7 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
else
|
||||
{
|
||||
(this->*opHandle.handler)(*packet);
|
||||
if (sLog.IsOutDebug() && packet->rpos() < packet->wpos())
|
||||
if (packet->rpos() < packet->wpos() && sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
||||
LogUnprocessedTail(packet);
|
||||
}
|
||||
break;
|
||||
|
|
@ -230,7 +230,7 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
m_playerRecentlyLogout = false;
|
||||
|
||||
(this->*opHandle.handler)(*packet);
|
||||
if (sLog.IsOutDebug() && packet->rpos() < packet->wpos())
|
||||
if (packet->rpos() < packet->wpos() && sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
||||
LogUnprocessedTail(packet);
|
||||
break;
|
||||
case STATUS_NEVER:
|
||||
|
|
@ -254,7 +254,7 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
{
|
||||
sLog.outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i.",
|
||||
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
|
||||
if(sLog.IsOutDebug())
|
||||
if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
||||
{
|
||||
sLog.outDebug("Dumping error causing packet:");
|
||||
packet->hexlike();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue