mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 05:55:07 +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:
@@ -29,7 +29,7 @@ Bag::~Bag()
|
||||
{
|
||||
if (item->IsInWorld())
|
||||
{
|
||||
sLog->outCrash("Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
|
||||
LOG_FATAL("server", "Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
|
||||
item->GetEntry(), (uint32)item->GetSlot(), (uint32)item->GetBagSlot(),
|
||||
GetEntry(), (uint32)GetSlot(), (uint32)GetBagSlot(), (uint32)i);
|
||||
item->RemoveFromWorld();
|
||||
|
||||
@@ -26,7 +26,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
||||
|
||||
if (!set)
|
||||
{
|
||||
sLog->outErrorDb("Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
|
||||
LOG_ERROR("sql.sql", "Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
|
||||
LOG_ERROR("server", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void RemoveItemsSetItem(Player* player, ItemTemplate const* proto)
|
||||
|
||||
if (!set)
|
||||
{
|
||||
sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
|
||||
LOG_ERROR("sql.sql", "Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
|
||||
LOG_DEBUG("entities.player.items", "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
|
||||
#endif
|
||||
|
||||
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
|
||||
@@ -588,7 +588,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
|
||||
// item can have not null only one from field values
|
||||
if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
|
||||
{
|
||||
sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
|
||||
LOG_ERROR("sql.sql", "Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -599,7 +599,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
|
||||
ItemRandomPropertiesEntry const* random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
|
||||
if (!random_id)
|
||||
{
|
||||
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
|
||||
LOG_ERROR("sql.sql", "Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
|
||||
ItemRandomSuffixEntry const* random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
|
||||
if (!random_id)
|
||||
{
|
||||
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
|
||||
LOG_ERROR("sql.sql", "Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ void Item::AddToUpdateQueueOf(Player* player)
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
|
||||
LOG_DEBUG("entities.player.items", "Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -728,7 +728,7 @@ void Item::RemoveFromUpdateQueueOf(Player* player)
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
|
||||
LOG_DEBUG("entities.player.items", "Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,13 +59,13 @@ void LoadRandomEnchantmentsTable()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
LOG_INFO("server", ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
|
||||
sLog->outString();
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
|
||||
LOG_INFO("server", " ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ uint32 GetItemEnchantMod(int32 entry)
|
||||
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
|
||||
if (tab == RandomItemEnch.end())
|
||||
{
|
||||
sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
|
||||
LOG_ERROR("sql.sql", "Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user