mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-04 19:43:48 +00:00
feat(Core/Logging): rework logging (#4692)
* feat(Core/Logging): rework logging * correct level for sql.sql * del unused config options * Correct build * correct after merge * whitespace 20:29:37 1. 'Player.cpp'. Replace (1) 20:29:37 2. 'ObjectMgr.cpp'. Replace (3) * 1 * correct logging * correct affter merge * 1 * 2 * LOG_LEVEL_WARN * #include "AppenderDB.h" * 3 * 4 * 5 * 1. 'WorldSocket.cpp'. Replace (1) * 6 * 1
This commit is contained in:
@@ -43,8 +43,8 @@ void LoadSkillDiscoveryTable()
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outErrorDb(">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
|
||||
sLog->outString();
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
|
||||
LOG_INFO("server", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void LoadSkillDiscoveryTable()
|
||||
{
|
||||
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
|
||||
{
|
||||
sLog->outErrorDb("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: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
|
||||
reportedReqSpells.insert(absReqSkillOrSpell);
|
||||
}
|
||||
continue;
|
||||
@@ -90,7 +90,7 @@ void LoadSkillDiscoveryTable()
|
||||
{
|
||||
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
|
||||
{
|
||||
sLog->outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
|
||||
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",
|
||||
absReqSkillOrSpell, spellId);
|
||||
reportedReqSpells.insert(absReqSkillOrSpell);
|
||||
@@ -106,7 +106,7 @@ void LoadSkillDiscoveryTable()
|
||||
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
sLog->outErrorDb("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: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ void LoadSkillDiscoveryTable()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
|
||||
LOG_ERROR("sql.sql", "Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void LoadSkillDiscoveryTable()
|
||||
} while (result->NextRow());
|
||||
|
||||
if (!ssNonDiscoverableEntries.str().empty())
|
||||
sLog->outErrorDb("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%s", ssNonDiscoverableEntries.str().c_str());
|
||||
|
||||
// report about empty data for explicit discovery spells
|
||||
for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
|
||||
@@ -137,11 +137,11 @@ void LoadSkillDiscoveryTable()
|
||||
continue;
|
||||
|
||||
if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())
|
||||
sLog->outErrorDb("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: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
|
||||
}
|
||||
|
||||
sLog->outString(">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
LOG_INFO("server", ">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
}
|
||||
|
||||
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
|
||||
|
||||
@@ -48,8 +48,8 @@ void LoadSkillPerfectItemTable()
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outErrorDb(">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty.");
|
||||
sLog->outString();
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty.");
|
||||
LOG_INFO("server", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,28 +63,28 @@ void LoadSkillPerfectItemTable()
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
sLog->outError("Skill perfection data for spell %u has non-existent spell id in `skill_perfect_item_template`!", spellId);
|
||||
LOG_ERROR("server", "Skill perfection data for spell %u has non-existent spell id in `skill_perfect_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 requiredSpecialization = fields[1].GetUInt32();
|
||||
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
|
||||
{
|
||||
sLog->outError("Skill perfection data for spell %u has non-existent required specialization spell id %u in `skill_perfect_item_template`!", spellId, requiredSpecialization);
|
||||
LOG_ERROR("server", "Skill perfection data for spell %u has non-existent required specialization spell id %u in `skill_perfect_item_template`!", spellId, requiredSpecialization);
|
||||
continue;
|
||||
}
|
||||
|
||||
float perfectCreateChance = fields[2].GetFloat();
|
||||
if (perfectCreateChance <= 0.0f)
|
||||
{
|
||||
sLog->outError("Skill perfection data for spell %u has impossibly low proc chance in `skill_perfect_item_template`!", spellId);
|
||||
LOG_ERROR("server", "Skill perfection data for spell %u has impossibly low proc chance in `skill_perfect_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 perfectItemType = fields[3].GetUInt32();
|
||||
if (!sObjectMgr->GetItemTemplate(perfectItemType))
|
||||
{
|
||||
sLog->outError("Skill perfection data for spell %u references non-existent perfect item id %u in `skill_perfect_item_template`!", spellId, perfectItemType);
|
||||
LOG_ERROR("server", "Skill perfection data for spell %u references non-existent perfect item id %u in `skill_perfect_item_template`!", spellId, perfectItemType);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ void LoadSkillPerfectItemTable()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u spell perfection definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
LOG_INFO("server", ">> Loaded %u spell perfection definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
}
|
||||
|
||||
struct SkillExtraItemEntry
|
||||
@@ -134,8 +134,8 @@ void LoadSkillExtraItemTable()
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outErrorDb(">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
|
||||
sLog->outString();
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
|
||||
LOG_INFO("server", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,28 +149,28 @@ void LoadSkillExtraItemTable()
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
sLog->outError("Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
|
||||
LOG_ERROR("server", "Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 requiredSpecialization = fields[1].GetUInt32();
|
||||
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
|
||||
{
|
||||
sLog->outError("Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
|
||||
LOG_ERROR("server", "Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
|
||||
continue;
|
||||
}
|
||||
|
||||
float additionalCreateChance = fields[2].GetFloat();
|
||||
if (additionalCreateChance <= 0.0f)
|
||||
{
|
||||
sLog->outError("Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
|
||||
LOG_ERROR("server", "Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
int32 newMaxOrEntry = fields[3].GetInt32();
|
||||
if (!newMaxOrEntry)
|
||||
{
|
||||
sLog->outError("Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
|
||||
LOG_ERROR("server", "Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -183,8 +183,8 @@ void LoadSkillExtraItemTable()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
LOG_INFO("server", ">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
}
|
||||
|
||||
bool CanCreatePerfectItem(Player* player, uint32 spellId, float& perfectCreateChance, uint32& perfectItemType)
|
||||
|
||||
Reference in New Issue
Block a user