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:
Kargatum
2022-01-27 22:44:41 +07:00
committed by GitHub
parent 5228d29379
commit 5969df4e30
211 changed files with 3689 additions and 3842 deletions

View File

@@ -86,13 +86,13 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket& recvData)
if (_player->IsBankPos(INVENTORY_SLOT_BAG_0, srcslot) && !CanUseBank())
{
//LOG_DEBUG("network", "WORLD: HandleSwapInvItemOpcode - Unit (%s) not found or you can't interact with him.", m_currentBankerGUID.ToString().c_str());
//LOG_DEBUG("network", "WORLD: HandleSwapInvItemOpcode - Unit ({}) not found or you can't interact with him.", m_currentBankerGUID.ToString());
return;
}
if (_player->IsBankPos(INVENTORY_SLOT_BAG_0, dstslot) && !CanUseBank())
{
//LOG_DEBUG("network", "WORLD: HandleSwapInvItemOpcode - Unit (%s) not found or you can't interact with him.", m_currentBankerGUID.ToString().c_str());
//LOG_DEBUG("network", "WORLD: HandleSwapInvItemOpcode - Unit ({}) not found or you can't interact with him.", m_currentBankerGUID.ToString());
return;
}
@@ -149,13 +149,13 @@ void WorldSession::HandleSwapItem(WorldPacket& recvData)
if (_player->IsBankPos(srcbag, srcslot) && !CanUseBank())
{
//LOG_DEBUG("network", "WORLD: HandleSwapItem - Unit (%s) not found or you can't interact with him.", m_currentBankerGUID.ToString().c_str());
//LOG_DEBUG("network", "WORLD: HandleSwapItem - Unit ({}) not found or you can't interact with him.", m_currentBankerGUID.ToString());
return;
}
if (_player->IsBankPos(dstbag, dstslot) && !CanUseBank())
{
//LOG_DEBUG("network", "WORLD: HandleSwapItem - Unit (%s) not found or you can't interact with him.", m_currentBankerGUID.ToString().c_str());
//LOG_DEBUG("network", "WORLD: HandleSwapItem - Unit ({}) not found or you can't interact with him.", m_currentBankerGUID.ToString());
return;
}
@@ -539,7 +539,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recvData)
uint32 item;
recvData >> item;
LOG_DEBUG("network.opcode", "STORAGE: Item Query = %u", item);
LOG_DEBUG("network.opcode", "STORAGE: Item Query = {}", item);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (pProto)
@@ -685,7 +685,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recvData)
}
else
{
LOG_DEBUG("network", "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item);
LOG_DEBUG("network", "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: {})", item);
WorldPacket queryData(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4);
queryData << uint32(item | 0x80000000);
SendPacket(&queryData);
@@ -699,7 +699,7 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
uint8 bag, slot;
recvData >> bag >> slot;
//LOG_DEBUG("network.opcode", "STORAGE: Read bag = %u, slot = %u", bag, slot);
//LOG_DEBUG("network.opcode", "STORAGE: Read bag = {}, slot = {}", bag, slot);
Item* pItem = _player->GetItemByPos(bag, slot);
if (pItem && pItem->GetTemplate()->PageText)
@@ -739,7 +739,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
LOG_DEBUG("network", "WORLD: HandleSellItemOpcode - Unit (%s) not found or you can not interact with him.", vendorguid.ToString().c_str());
LOG_DEBUG("network", "WORLD: HandleSellItemOpcode - Unit ({}) not found or you can not interact with him.", vendorguid.ToString());
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, itemguid, 0);
return;
}
@@ -815,7 +815,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
Item* pNewItem = pItem->CloneItem(count, _player);
if (!pNewItem)
{
LOG_ERROR("network.opcode", "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
LOG_ERROR("network.opcode", "WORLD: HandleSellItemOpcode - could not create clone of item {}; count = {}", pItem->GetEntry(), count);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
@@ -863,7 +863,7 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
LOG_DEBUG("network", "WORLD: HandleBuybackItem - Unit (%s) not found or you can not interact with him.", vendorguid.ToString().c_str());
LOG_DEBUG("network", "WORLD: HandleBuybackItem - Unit ({}) not found or you can not interact with him.", vendorguid.ToString());
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, ObjectGuid::Empty, 0);
return;
}
@@ -989,7 +989,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
Creature* vendor = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR);
if (!vendor)
{
LOG_DEBUG("network", "WORLD: SendListInventory - Unit (%s) not found or you can not interact with him.", vendorGuid.ToString().c_str());
LOG_DEBUG("network", "WORLD: SendListInventory - Unit ({}) not found or you can not interact with him.", vendorGuid.ToString());
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, ObjectGuid::Empty, 0);
return;
}
@@ -1056,7 +1056,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
ConditionList conditions = sConditionMgr->GetConditionsForNpcVendorEvent(vendor->GetEntry(), item->item);
if (!sConditionMgr->IsObjectMeetToConditions(_player, vendor, conditions))
{
LOG_DEBUG("network", "SendListInventory: conditions not met for creature entry %u item %u", vendor->GetEntry(), item->item);
LOG_DEBUG("network", "SendListInventory: conditions not met for creature entry {} item {}", vendor->GetEntry(), item->item);
continue;
}
@@ -1196,7 +1196,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket& recvData)
recvData >> itemid;
recvData.read_skip<uint64>(); // guid
LOG_DEBUG("network", "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
LOG_DEBUG("network", "WORLD: CMSG_ITEM_NAME_QUERY {}", itemid);
ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid);
if (pName)
{
@@ -1223,7 +1223,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
recvData >> gift_bag >> gift_slot; // paper
recvData >> item_bag >> item_slot; // item
LOG_DEBUG("network", "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot);
LOG_DEBUG("network", "WRAP: receive gift_bag = {}, gift_slot = {}, item_bag = {}, item_slot = {}", gift_bag, gift_slot, item_bag, item_slot);
Item* gift = _player->GetItemByPos(gift_bag, gift_slot);
if (!gift)
@@ -1610,7 +1610,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket& recvData )
ObjectGuid itemGuid;
recvData >> itemGuid;
LOG_DEBUG("network", "CMSG_ITEM_TEXT_QUERY item: %s", itemGuid.ToString().c_str());
LOG_DEBUG("network", "CMSG_ITEM_TEXT_QUERY item: {}", itemGuid.ToString());
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, 50); // guess size