mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 17:13:47 +00:00
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:
@@ -26,9 +26,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
// object not present, return false
|
||||
if (!object)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "Condition object not found for condition (Entry: %u Type: %u Group: %u)", SourceEntry, SourceType, SourceGroup);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
bool condMeets = false;
|
||||
@@ -693,9 +691,7 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
|
||||
std::map<uint32, bool> ElseGroupStore;
|
||||
for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1);
|
||||
#endif
|
||||
if ((*i)->isLoaded())
|
||||
{
|
||||
//! Find ElseGroup in ElseGroupStore
|
||||
@@ -716,9 +712,7 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->ReferenceId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else //handle normal condition
|
||||
@@ -752,9 +746,7 @@ bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, Con
|
||||
if (conditions.empty())
|
||||
return true;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "ConditionMgr::IsObjectMeetToConditions");
|
||||
#endif
|
||||
return IsObjectMeetToConditionList(sourceInfo, conditions);
|
||||
}
|
||||
|
||||
@@ -798,9 +790,7 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType
|
||||
if (i != (*itr).second.end())
|
||||
{
|
||||
spellCond = (*i).second;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sourceType), entry);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -817,9 +807,7 @@ ConditionList ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, u
|
||||
if (i != (*itr).second.end())
|
||||
{
|
||||
cond = (*i).second;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "GetConditionsForSpellClickEvent: found conditions for Vehicle entry %u spell %u", creatureId, spellId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return cond;
|
||||
@@ -835,9 +823,7 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint
|
||||
if (i != (*itr).second.end())
|
||||
{
|
||||
cond = (*i).second;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureId, spellId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return cond;
|
||||
@@ -853,9 +839,7 @@ ConditionList ConditionMgr::GetConditionsForSmartEvent(int32 entryOrGuid, uint32
|
||||
if (i != (*itr).second.end())
|
||||
{
|
||||
cond = (*i).second;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("condition", "GetConditionsForSmartEvent: found conditions for Smart Event entry or guid %d event_id %u", entryOrGuid, eventId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return cond;
|
||||
@@ -886,7 +870,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
//must clear all custom handled cases (groupped types) before reload
|
||||
if (isReload)
|
||||
{
|
||||
LOG_INFO("server", "Reseting Loot Conditions...");
|
||||
LOG_INFO("server.loading", "Reseting Loot Conditions...");
|
||||
LootTemplates_Creature.ResetConditions();
|
||||
LootTemplates_Fishing.ResetConditions();
|
||||
LootTemplates_Gameobject.ResetConditions();
|
||||
@@ -900,10 +884,10 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
LootTemplates_Prospecting.ResetConditions();
|
||||
LootTemplates_Spell.ResetConditions();
|
||||
|
||||
LOG_INFO("server", "Re-Loading `gossip_menu` Table for Conditions!");
|
||||
LOG_INFO("server.loading", "Re-Loading `gossip_menu` Table for Conditions!");
|
||||
sObjectMgr->LoadGossipMenu();
|
||||
|
||||
LOG_INFO("server", "Re-Loading `gossip_menu_option` Table for Conditions!");
|
||||
LOG_INFO("server.loading", "Re-Loading `gossip_menu_option` Table for Conditions!");
|
||||
sObjectMgr->LoadGossipMenuItems();
|
||||
sSpellMgr->UnloadSpellInfoImplicitTargetConditionLists();
|
||||
}
|
||||
@@ -913,7 +897,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("server", ">> Loaded 0 conditions. DB table `conditions` is empty!");
|
||||
LOG_ERROR("server.loading", ">> Loaded 0 conditions. DB table `conditions` is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1016,13 +1000,13 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
|
||||
if (cond->ErrorType && cond->SourceType != CONDITION_SOURCE_TYPE_SPELL)
|
||||
{
|
||||
LOG_ERROR("server", "Condition type %u entry %i can't have ErrorType (%u), set to 0!", uint32(cond->SourceType), cond->SourceEntry, cond->ErrorType);
|
||||
LOG_ERROR("condition", "Condition type %u entry %i can't have ErrorType (%u), set to 0!", uint32(cond->SourceType), cond->SourceEntry, cond->ErrorType);
|
||||
cond->ErrorType = 0;
|
||||
}
|
||||
|
||||
if (cond->ErrorTextId && !cond->ErrorType)
|
||||
{
|
||||
LOG_ERROR("server", "Condition type %u entry %i has any ErrorType, ErrorTextId (%u) is set, set to 0!", uint32(cond->SourceType), cond->SourceEntry, cond->ErrorTextId);
|
||||
LOG_ERROR("condition", "Condition type %u entry %i has any ErrorType, ErrorTextId (%u) is set, set to 0!", uint32(cond->SourceType), cond->SourceEntry, cond->ErrorTextId);
|
||||
cond->ErrorTextId = 0;
|
||||
}
|
||||
|
||||
@@ -1144,8 +1128,8 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server", ">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot)
|
||||
@@ -1611,13 +1595,13 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
{
|
||||
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
|
||||
{
|
||||
LOG_ERROR("server", "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
|
||||
LOG_ERROR("condition", "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
|
||||
return false;
|
||||
}
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!itemTemplate)
|
||||
{
|
||||
LOG_ERROR("server", "SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceEntry);
|
||||
LOG_ERROR("condition", "SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceEntry);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1874,14 +1858,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
{
|
||||
if (!Player::IsValidGender(uint8(cond->ConditionValue1)))
|
||||
{
|
||||
LOG_ERROR("server", "Gender condition has invalid gender (%u), skipped", cond->ConditionValue1);
|
||||
LOG_ERROR("condition", "Gender condition has invalid gender (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cond->ConditionValue2)
|
||||
LOG_ERROR("server", "Gender condition has useless data in value2 (%u)!", cond->ConditionValue2);
|
||||
LOG_ERROR("condition", "Gender condition has useless data in value2 (%u)!", cond->ConditionValue2);
|
||||
if (cond->ConditionValue3)
|
||||
LOG_ERROR("server", "Gender condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
LOG_ERROR("condition", "Gender condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_MAPID:
|
||||
@@ -2168,7 +2152,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
{
|
||||
if (cond->ConditionValue1 > SPAWNMASK_RAID_ALL)
|
||||
{
|
||||
LOG_ERROR("server", "SpawnMask condition has non existing SpawnMask in value1 (%u), skipped", cond->ConditionValue1);
|
||||
LOG_ERROR("condition", "SpawnMask condition has non existing SpawnMask in value1 (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -2177,7 +2161,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
{
|
||||
if (!(cond->ConditionValue1 & UNIT_STATE_ALL_STATE_SUPPORTED))
|
||||
{
|
||||
LOG_ERROR("server", "UnitState condition has non existing UnitState in value1 (%u), skipped", cond->ConditionValue1);
|
||||
LOG_ERROR("condition", "UnitState condition has non existing UnitState in value1 (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -2186,7 +2170,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
{
|
||||
if (!cond->ConditionValue1 || cond->ConditionValue1 > CREATURE_TYPE_GAS_CLOUD)
|
||||
{
|
||||
LOG_ERROR("server", "CreatureType condition has non existing CreatureType in value1 (%u), skipped", cond->ConditionValue1);
|
||||
LOG_ERROR("condition", "CreatureType condition has non existing CreatureType in value1 (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -2196,7 +2180,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1);
|
||||
if (!achievement)
|
||||
{
|
||||
LOG_ERROR("server", "CONDITION_REALM_ACHIEVEMENT has non existing realm first achivement id (%u), skipped.", cond->ConditionValue1);
|
||||
LOG_ERROR("condition", "CONDITION_REALM_ACHIEVEMENT has non existing realm first achivement id (%u), skipped.", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace DisableMgr
|
||||
|
||||
if (!result)
|
||||
{
|
||||
LOG_INFO("server", ">> Loaded 0 disables. DB table `disables` is empty!");
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded 0 disables. DB table `disables` is empty!");
|
||||
LOG_INFO("server.loading", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -198,28 +198,28 @@ namespace DisableMgr
|
||||
{
|
||||
case MAP_COMMON:
|
||||
if (flags & VMAP::VMAP_DISABLE_AREAFLAG)
|
||||
LOG_INFO("server", "Areaflag disabled for world map %u.", entry);
|
||||
LOG_INFO("disable", "Areaflag disabled for world map %u.", entry);
|
||||
if (flags & VMAP::VMAP_DISABLE_LIQUIDSTATUS)
|
||||
LOG_INFO("server", "Liquid status disabled for world map %u.", entry);
|
||||
LOG_INFO("disable", "Liquid status disabled for world map %u.", entry);
|
||||
break;
|
||||
case MAP_INSTANCE:
|
||||
case MAP_RAID:
|
||||
if (flags & VMAP::VMAP_DISABLE_HEIGHT)
|
||||
LOG_INFO("server", "Height disabled for instance map %u.", entry);
|
||||
LOG_INFO("disable", "Height disabled for instance map %u.", entry);
|
||||
if (flags & VMAP::VMAP_DISABLE_LOS)
|
||||
LOG_INFO("server", "LoS disabled for instance map %u.", entry);
|
||||
LOG_INFO("disable", "LoS disabled for instance map %u.", entry);
|
||||
break;
|
||||
case MAP_BATTLEGROUND:
|
||||
if (flags & VMAP::VMAP_DISABLE_HEIGHT)
|
||||
LOG_INFO("server", "Height disabled for battleground map %u.", entry);
|
||||
LOG_INFO("disable", "Height disabled for battleground map %u.", entry);
|
||||
if (flags & VMAP::VMAP_DISABLE_LOS)
|
||||
LOG_INFO("server", "LoS disabled for battleground map %u.", entry);
|
||||
LOG_INFO("disable", "LoS disabled for battleground map %u.", entry);
|
||||
break;
|
||||
case MAP_ARENA:
|
||||
if (flags & VMAP::VMAP_DISABLE_HEIGHT)
|
||||
LOG_INFO("server", "Height disabled for arena map %u.", entry);
|
||||
LOG_INFO("disable", "Height disabled for arena map %u.", entry);
|
||||
if (flags & VMAP::VMAP_DISABLE_LOS)
|
||||
LOG_INFO("server", "LoS disabled for arena map %u.", entry);
|
||||
LOG_INFO("disable", "LoS disabled for arena map %u.", entry);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -234,8 +234,8 @@ namespace DisableMgr
|
||||
++total_count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server", ">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
void CheckQuestDisables()
|
||||
@@ -245,8 +245,8 @@ namespace DisableMgr
|
||||
uint32 count = m_DisableMap[DISABLE_TYPE_QUEST].size();
|
||||
if (!count)
|
||||
{
|
||||
LOG_INFO("server", ">> Checked 0 quest disables.");
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Checked 0 quest disables.");
|
||||
LOG_INFO("server.loading", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,8 +265,8 @@ namespace DisableMgr
|
||||
++itr;
|
||||
}
|
||||
|
||||
LOG_INFO("server", ">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags)
|
||||
|
||||
Reference in New Issue
Block a user