mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +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:
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("misc", "Account %u not found in login database when processing .account 2fa setup command.", accountId);
|
||||
LOG_ERROR("misc", "Account {} not found in login database when processing .account 2fa setup command.", accountId);
|
||||
handler->SendSysMessage(LANG_UNKNOWN_ERROR);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("misc", "Account %u not found in login database when processing .account 2fa setup command.", accountId);
|
||||
LOG_ERROR("misc", "Account {} not found in login database when processing .account 2fa setup command.", accountId);
|
||||
handler->SendSysMessage(LANG_UNKNOWN_ERROR);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
bool success = Acore::Crypto::AEDecrypt<Acore::Crypto::AES>(secret, *masterKey);
|
||||
if (!success)
|
||||
{
|
||||
LOG_ERROR("misc", "Account %u has invalid ciphertext in TOTP token.", accountId);
|
||||
LOG_ERROR("misc", "Account {} has invalid ciphertext in TOTP token.", accountId);
|
||||
handler->SendSysMessage(LANG_UNKNOWN_ERROR);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
@@ -301,9 +301,9 @@ public:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
|
||||
if (handler->GetSession())
|
||||
{
|
||||
LOG_DEBUG("warden", "Account: %d (IP: %s) Character:[%s] (%s) Change Password.",
|
||||
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("warden", "Account: {} (IP: {}) Character:[{}] ({}) Change Password.",
|
||||
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(),
|
||||
handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString());
|
||||
}
|
||||
break;
|
||||
case AOR_NAME_TOO_LONG:
|
||||
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Sending opcode that has unknown type '%s'", type.c_str());
|
||||
LOG_ERROR("network.opcode", "Sending opcode that has unknown type '{}'", type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1240,7 +1240,7 @@ public:
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
LOG_INFO("sql.dev", "(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
LOG_INFO("sql.dev", "(@PATH, XX, {0:.3f}, {0:.3f}, {0:.5f}, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
|
||||
handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
|
||||
return true;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
if (objectInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(objectInfo->displayId))
|
||||
{
|
||||
// report to DB errors log as in loading case
|
||||
LOG_ERROR("sql.sql", "Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.", *objectId, objectInfo->type, objectInfo->displayId);
|
||||
LOG_ERROR("sql.sql", "Gameobject (Entry {} GoType: {}) have invalid displayId ({}), not spawned.", *objectId, objectInfo->type, objectInfo->displayId);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA, uint32(objectId));
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
Movement::PointsArray const& pointPath = path.GetPath();
|
||||
handler->PSendSysMessage("%s's path to %s:", target->GetName().c_str(), player->GetName().c_str());
|
||||
handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useRaycast ? "Raycast" : "SmoothPath");
|
||||
handler->PSendSysMessage("Result: %s - Length: " SZFMTD " - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType());
|
||||
handler->PSendSysMessage(Acore::StringFormatFmt("Result: {} - Length: {} - Type: {}", (result ? "true" : "false"), pointPath.size(), path.GetPathType()).c_str());
|
||||
|
||||
G3D::Vector3 const& start = path.GetStartPosition();
|
||||
G3D::Vector3 const& end = path.GetEndPosition();
|
||||
@@ -270,7 +270,7 @@ public:
|
||||
|
||||
if (!creatureList.empty())
|
||||
{
|
||||
handler->PSendSysMessage("Found " SZFMTD " Creatures.", creatureList.size());
|
||||
handler->PSendSysMessage(Acore::StringFormatFmt("Found {} Creatures.", creatureList.size()).c_str());
|
||||
|
||||
uint32 paths = 0;
|
||||
uint32 uStartTime = getMSTime();
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_INFO("server.loading", "Reloading creature template entry %u", entry);
|
||||
LOG_INFO("server.loading", "Reloading creature template entry {}", entry);
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass());
|
||||
if (!classEntry)
|
||||
{
|
||||
LOG_ERROR("dbc", "Class %u not found in DBC (Wrong DBC files?)", player->getClass());
|
||||
LOG_ERROR("dbc", "Class {} not found in DBC (Wrong DBC files?)", player->getClass());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
dbPort = (*res)[0].GetUInt16();
|
||||
|
||||
if (dbPort)
|
||||
dbPortOutput = Acore::StringFormat("Realmlist (Realm Id: %u) configured in port %" PRIu16, realm.Id.Realm, dbPort);
|
||||
dbPortOutput = Acore::StringFormatFmt("Realmlist (Realm Id: {}) configured in port {}", realm.Id.Realm, dbPort);
|
||||
else
|
||||
dbPortOutput = Acore::StringFormat("Realm Id: %u not found in `realmlist` table. Please check your setup", realm.Id.Realm);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
return val;
|
||||
});
|
||||
|
||||
handler->PSendSysMessage("%s directory located in %s. Total size: " SZFMTD " bytes", subDir.c_str(), mapPath.generic_string().c_str(), folderSize);
|
||||
handler->PSendSysMessage(Acore::StringFormatFmt("{} directory located in {}. Total size: {} bytes", subDir.c_str(), mapPath.generic_string().c_str(), folderSize).c_str());
|
||||
}
|
||||
|
||||
LocaleConstant defaultLocale = sWorld->GetDefaultDbcLocale();
|
||||
|
||||
Reference in New Issue
Block a user