mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
refactor(Core/Logging): switch to fmt style for LOG_ (#10366)
* feat(Core/Common): add support fmt style for ASSERT and ABORT * correct CheckCompactArrayMaskOverflow * 1 * Update src/server/game/Spells/Spell.cpp * rework logging * add fmt replace logs * logging * FMT_LOG_ * settings * fix startup * 1 * 2 * 3 * 4 * 5 * fmt::print * to fmt
This commit is contained in:
@@ -88,7 +88,7 @@ void LoadSkillDiscoveryTable()
|
||||
{
|
||||
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
|
||||
LOG_ERROR("sql.sql", "Spell (ID: {}) have not existed spell (ID: {}) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
|
||||
reportedReqSpells.insert(absReqSkillOrSpell);
|
||||
}
|
||||
continue;
|
||||
@@ -101,8 +101,8 @@ void LoadSkillDiscoveryTable()
|
||||
{
|
||||
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
|
||||
" and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
|
||||
LOG_ERROR("sql.sql", "Spell (ID: {}) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
|
||||
" and not 100% chance random discovery ability but listed for spellId {} (and maybe more) in `skill_discovery_template` table",
|
||||
absReqSkillOrSpell, spellId);
|
||||
reportedReqSpells.insert(absReqSkillOrSpell);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void LoadSkillDiscoveryTable()
|
||||
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
|
||||
LOG_ERROR("sql.sql", "Spell (ID: {}) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void LoadSkillDiscoveryTable()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
|
||||
LOG_ERROR("sql.sql", "Spell (ID: {}) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void LoadSkillDiscoveryTable()
|
||||
} while (result->NextRow());
|
||||
|
||||
if (!ssNonDiscoverableEntries.str().empty())
|
||||
LOG_ERROR("sql.sql", "Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
|
||||
LOG_ERROR("sql.sql", "Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n{}", ssNonDiscoverableEntries.str());
|
||||
|
||||
// report about empty data for explicit discovery spells
|
||||
for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
|
||||
@@ -148,10 +148,10 @@ void LoadSkillDiscoveryTable()
|
||||
continue;
|
||||
|
||||
if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())
|
||||
LOG_ERROR("sql.sql", "Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
|
||||
LOG_ERROR("sql.sql", "Spell (ID: {}) is 100% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
|
||||
}
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} skill discovery definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
|
||||
@@ -75,28 +75,28 @@ void LoadSkillPerfectItemTable()
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell %u has non-existent spell id in `skill_perfect_item_template`!", spellId);
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell {} has non-existent spell id in `skill_perfect_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 requiredSpecialization = fields[1].GetUInt32();
|
||||
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell %u has non-existent required specialization spell id %u in `skill_perfect_item_template`!", spellId, requiredSpecialization);
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell {} has non-existent required specialization spell id {} in `skill_perfect_item_template`!", spellId, requiredSpecialization);
|
||||
continue;
|
||||
}
|
||||
|
||||
float perfectCreateChance = fields[2].GetFloat();
|
||||
if (perfectCreateChance <= 0.0f)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell %u has impossibly low proc chance in `skill_perfect_item_template`!", spellId);
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell {} has impossibly low proc chance in `skill_perfect_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 perfectItemType = fields[3].GetUInt32();
|
||||
if (!sObjectMgr->GetItemTemplate(perfectItemType))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell %u references non-existent perfect item id %u in `skill_perfect_item_template`!", spellId, perfectItemType);
|
||||
LOG_ERROR("sql.sql", "Skill perfection data for spell {} references non-existent perfect item id {} in `skill_perfect_item_template`!", spellId, perfectItemType);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void LoadSkillPerfectItemTable()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u spell perfection definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} spell perfection definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -161,28 +161,28 @@ void LoadSkillExtraItemTable()
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
|
||||
LOG_ERROR("sql.sql", "Skill specialization {} has non-existent spell id in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 requiredSpecialization = fields[1].GetUInt32();
|
||||
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
|
||||
LOG_ERROR("sql.sql", "Skill specialization {} have not existed required specialization spell id {} in `skill_extra_item_template`!", spellId, requiredSpecialization);
|
||||
continue;
|
||||
}
|
||||
|
||||
float additionalCreateChance = fields[2].GetFloat();
|
||||
if (additionalCreateChance <= 0.0f)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
|
||||
LOG_ERROR("sql.sql", "Skill specialization {} has too low additional create chance in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
int32 newMaxOrEntry = fields[3].GetInt32();
|
||||
if (!newMaxOrEntry)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
|
||||
LOG_ERROR("sql.sql", "Skill specialization {} has 0 max number of extra items in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ void LoadSkillExtraItemTable()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} spell specialization definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user