chore(Core/Logging): replace most server loggers (#5726)

* chore(Core/Logging): replace most server loggers

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Kargatum
2021-06-21 08:07:12 +07:00
committed by GitHub
parent 9f80a592bb
commit 5787d00d54
199 changed files with 2312 additions and 4487 deletions

View File

@@ -200,9 +200,6 @@ Creature::~Creature()
delete i_AI;
i_AI = nullptr;
//if (m_uint32Values)
// LOG_ERROR("server", "Deconstruct Creature Entry = %u", GetEntry());
}
void Creature::AddToWorld()
@@ -542,11 +539,11 @@ void Creature::Update(uint32 diff)
{
case JUST_RESPAWNED:
// Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting.
LOG_ERROR("server", "Creature (%s) in wrong state: JUST_RESPAWNED (4)", GetGUID().ToString().c_str());
LOG_ERROR("entities.unit", "Creature (%s) in wrong state: JUST_RESPAWNED (4)", GetGUID().ToString().c_str());
break;
case JUST_DIED:
// Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
LOG_ERROR("server", "Creature (%s) in wrong state: JUST_DEAD (1)", GetGUID().ToString().c_str());
LOG_ERROR("entities.unit", "Creature (%s) in wrong state: JUST_DEAD (1)", GetGUID().ToString().c_str());
break;
case DEAD:
{
@@ -595,9 +592,7 @@ void Creature::Update(uint32 diff)
else if (m_corpseRemoveTime <= time(nullptr))
{
RemoveCorpse(false);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
#endif
LOG_DEBUG("entities.unit", "Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
}
break;
}
@@ -910,9 +905,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
// make sure nothing can change the AI during AI update
if (m_AI_locked)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("scripts.ai", "AIM_Initialize: failed to init, locked.");
#endif
return false;
}
@@ -970,7 +963,7 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
if (!IsPositionValid())
{
LOG_ERROR("server", "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
LOG_ERROR("entities.unit", "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
return false;
}
@@ -1187,7 +1180,7 @@ void Creature::SaveToDB()
CreatureData const* data = sObjectMgr->GetCreatureData(m_spawnId);
if (!data)
{
LOG_ERROR("server", "Creature::SaveToDB failed, cannot get creature data!");
LOG_ERROR("entities.unit", "Creature::SaveToDB failed, cannot get creature data!");
return;
}
@@ -1635,7 +1628,7 @@ void Creature::DeleteFromDB()
{
if (!m_spawnId)
{
LOG_ERROR("server", "Trying to delete not saved creature: %s", GetGUID().ToString().c_str());
LOG_ERROR("entities.unit", "Trying to delete not saved creature: %s", GetGUID().ToString().c_str());
return;
}
@@ -1825,9 +1818,7 @@ void Creature::Respawn(bool force)
if (m_spawnId)
GetMap()->RemoveCreatureRespawnTime(m_spawnId);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Respawning creature %s (SpawnId: %u, %s)", GetName().c_str(), GetSpawnId(), GetGUID().ToString().c_str());
#endif
LOG_DEBUG("entities.unit", "Respawning creature %s (SpawnId: %u, %s)", GetName().c_str(), GetSpawnId(), GetGUID().ToString().c_str());
m_respawnTime = 0;
ResetPickPocketLootTime();
@@ -1991,7 +1982,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
LOG_ERROR("server", "WORLD: unknown spell id %i", m_spells[i]);
LOG_ERROR("entities.unit", "WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -2039,7 +2030,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
LOG_ERROR("server", "WORLD: unknown spell id %i", m_spells[i]);
LOG_ERROR("entities.unit", "WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -2115,9 +2106,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
((WorldObject*)this)->SendMessageToSet(&data, true);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
#endif
}
void Creature::CallAssistance()
@@ -2445,9 +2434,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
}
AddAura(*itr, this);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("entities.unit", "Spell: %u added to creature (%s)", *itr, GetGUID().ToString().c_str());
#endif
}
}
@@ -2466,7 +2453,7 @@ void Creature::SetInCombatWithZone()
{
if (!CanHaveThreatList())
{
LOG_ERROR("server", "Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
LOG_ERROR("entities.unit", "Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
return;
}
@@ -2474,7 +2461,7 @@ void Creature::SetInCombatWithZone()
if (!map->IsDungeon())
{
LOG_ERROR("server", "Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
LOG_ERROR("entities.unit", "Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
return;
}