mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 23:11:56 -04:00
Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
Memleak fix
This commit is contained in:
@@ -118,7 +118,7 @@ void GameObject::RemoveFromOwner()
|
||||
else if (IS_PET_GUID(ownerGUID))
|
||||
ownerType = "pet";
|
||||
|
||||
sLog->outFatal(LOG_FILTER_GENERAL, "Removed GameObject (GUID: %u Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (GUID: %u Type: '%s') GO list",
|
||||
TC_LOG_FATAL(LOG_FILTER_GENERAL, "Removed GameObject (GUID: %u Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (GUID: %u Type: '%s') GO list",
|
||||
GetGUIDLow(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), GUID_LOPART(ownerGUID), ownerType);
|
||||
SetOwnerGUID(0);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
|
||||
Relocate(x, y, z, ang);
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
|
||||
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
|
||||
if (!goinfo)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
|
||||
|
||||
if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (!AI())
|
||||
{
|
||||
if (!AIM_Initialize())
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Could not initialize GameObjectAI");
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "Could not initialize GameObjectAI");
|
||||
} else
|
||||
AI()->UpdateAI(diff);
|
||||
|
||||
@@ -658,7 +658,7 @@ void GameObject::SaveToDB()
|
||||
GameObjectData const* data = sObjectMgr->GetGOData(m_DBTableGuid);
|
||||
if (!data)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
|
||||
|
||||
if (!data)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1249,7 +1249,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if (info->goober.eventId)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
|
||||
TC_LOG_DEBUG(LOG_FILTER_MAPSCRIPTS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
|
||||
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
|
||||
EventInform(info->goober.eventId);
|
||||
}
|
||||
@@ -1330,7 +1330,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
//provide error, no fishable zone or area should be 0
|
||||
if (!zone_skill)
|
||||
sLog->outError(LOG_FILTER_SQL, "Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
|
||||
|
||||
int32 skill = player->GetSkillValue(SKILL_FISHING);
|
||||
|
||||
@@ -1346,7 +1346,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
int32 roll = irand(1, 100);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
|
||||
TC_LOG_DEBUG(LOG_FILTER_GENERAL, "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
|
||||
|
||||
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
|
||||
if (chance >= roll)
|
||||
@@ -1651,7 +1651,7 @@ void GameObject::Use(Unit* user)
|
||||
}
|
||||
default:
|
||||
if (GetGoType() >= MAX_GAMEOBJECT_TYPE)
|
||||
sLog->outError(LOG_FILTER_GENERAL, "GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
|
||||
user->GetTypeId(), user->GetGUIDLow(), user->GetName().c_str(), GetGUIDLow(), GetEntry(), GetGOInfo()->name.c_str(), GetGoType());
|
||||
break;
|
||||
}
|
||||
@@ -1663,9 +1663,9 @@ void GameObject::Use(Unit* user)
|
||||
if (!spellInfo)
|
||||
{
|
||||
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this))
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
|
||||
else
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
|
||||
TC_LOG_DEBUG(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user