mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 08:16:08 +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:
@@ -254,7 +254,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
|
||||
itr2 = itr++;
|
||||
if (!bg->IsPlayerInBattleground(itr2->first))
|
||||
{
|
||||
LOG_ERROR("bg.battleground", "Player %s has scoreboard entry for battleground %u but is not in battleground!", itr->first.ToString().c_str(), bg->GetBgTypeID());
|
||||
LOG_ERROR("bg.battleground", "Player {} has scoreboard entry for battleground {} but is not in battleground!", itr->first.ToString(), bg->GetBgTypeID());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
|
||||
// should never happen
|
||||
if (++scoreCount >= bg->GetMaxPlayersPerTeam() * 2 && itr != bg->GetPlayerScoresEnd())
|
||||
{
|
||||
LOG_INFO("misc", "Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bgTypeId, bg->GetPlayerScoresSize(), bg->GetMaxPlayersPerTeam() * 2);
|
||||
LOG_INFO("misc", "Battleground {} scoreboard has more entries ({}) than allowed players in this bg ({})", bgTypeId, bg->GetPlayerScoresSize(), bg->GetMaxPlayersPerTeam() * 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -537,7 +537,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
|
||||
if (!bl)
|
||||
{
|
||||
LOG_ERROR("bg.battleground", "Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeId);
|
||||
LOG_ERROR("bg.battleground", "Battleground ID {} not found in BattlemasterList.dbc. Battleground not created.", bgTypeId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -558,14 +558,14 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
|
||||
if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam)
|
||||
{
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)",
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id {} has bad values for MinPlayersPerTeam ({}) and MaxPlayersPerTeam({})",
|
||||
data.bgTypeId, data.MinPlayersPerTeam, data.MaxPlayersPerTeam);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data.LevelMin == 0 || data.LevelMax == 0 || data.LevelMin > data.LevelMax)
|
||||
{
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)",
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id {} has bad values for LevelMin ({}) and LevelMax({})",
|
||||
data.bgTypeId, data.LevelMin, data.LevelMax);
|
||||
continue;
|
||||
}
|
||||
@@ -593,7 +593,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id %u have non-existed `game_graveyard` table id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id {} have non-existed `game_graveyard` table id {} in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id %u have non-existed `game_graveyard` table id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
LOG_ERROR("bg.battleground", "Table `battleground_template` for id {} have non-existed `game_graveyard` table id {} in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -623,7 +623,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} battlegrounds in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -869,18 +869,18 @@ void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry))
|
||||
{
|
||||
if ((cInfo->npcflag & UNIT_NPC_FLAG_BATTLEMASTER) == 0)
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: %u) listed in `battlemaster_entry` is not a battlemaster.", entry);
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) listed in `battlemaster_entry` is not a battlemaster.", entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: %u) listed in `battlemaster_entry` does not exist.", entry);
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) listed in `battlemaster_entry` does not exist.", entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 bgTypeId = fields[1].GetUInt32();
|
||||
if (!sBattlemasterListStore.LookupEntry(bgTypeId))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
|
||||
LOG_ERROR("sql.sql", "Table `battlemaster_entry` contain entry {} for not existed battleground type {}, ignored.", entry, bgTypeId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -889,7 +889,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
|
||||
CheckBattleMasters();
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} battlemaster entries in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -900,7 +900,7 @@ void BattlegroundMgr::CheckBattleMasters()
|
||||
{
|
||||
if ((itr->second.npcflag & UNIT_NPC_FLAG_BATTLEMASTER) && mBattleMastersMap.find(itr->second.Entry) == mBattleMastersMap.end())
|
||||
{
|
||||
LOG_ERROR("sql.sql", "CreatureTemplate (Entry: %u) has UNIT_NPC_FLAG_BATTLEMASTER but no data in `battlemaster_entry` table. Removing flag!", itr->second.Entry);
|
||||
LOG_ERROR("sql.sql", "CreatureTemplate (Entry: {}) has UNIT_NPC_FLAG_BATTLEMASTER but no data in `battlemaster_entry` table. Removing flag!", itr->second.Entry);
|
||||
const_cast<CreatureTemplate*>(&itr->second)->npcflag &= ~UNIT_NPC_FLAG_BATTLEMASTER;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user