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:
@@ -104,14 +104,14 @@ bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 map, float
|
||||
bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Creating capture point %u", entry);
|
||||
LOG_DEBUG("outdoorpvp", "Creating capture point %u", entry);
|
||||
#endif
|
||||
|
||||
// check info existence
|
||||
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
|
||||
{
|
||||
sLog->outError("OutdoorPvP: GO %u is not capture point!", entry);
|
||||
LOG_ERROR("server", "OutdoorPvP: GO %u is not capture point!", entry);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
|
||||
if (!m_Creatures[type])
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted", type);
|
||||
LOG_DEBUG("outdoorpvp", "opvp creature type %u was already deleted", type);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
|
||||
return false;
|
||||
}
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u", type);
|
||||
LOG_DEBUG("outdoorpvp", "deleting opvp creature type %u", type);
|
||||
#endif
|
||||
uint32 guid = cr->GetDBTableGUIDLow();
|
||||
// Don't save respawn time
|
||||
@@ -246,7 +246,7 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/)
|
||||
SendRemoveWorldStates(player);
|
||||
m_players[player->GetTeamId()].erase(player->GetGUID());
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %s left an outdoorpvp zone", player->GetName().c_str());
|
||||
LOG_DEBUG("outdoorpvp", "Player %s left an outdoorpvp zone", player->GetName().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
|
||||
if (m_OldState != m_State)
|
||||
{
|
||||
//sLog->outError(LOG_FILTER_OUTDOORPVP, "%u->%u", m_OldState, m_State);
|
||||
//LOG_ERROR("server", LOG_FILTER_OUTDOORPVP, "%u->%u", m_OldState, m_State);
|
||||
if (oldTeam != m_team)
|
||||
ChangeTeam(oldTeam);
|
||||
ChangeState();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
OutdoorPvPMgr::OutdoorPvPMgr()
|
||||
{
|
||||
m_UpdateTimer = 0;
|
||||
//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Instantiating OutdoorPvPMgr");
|
||||
//LOG_DEBUG("outdoorpvp", "Instantiating OutdoorPvPMgr");
|
||||
}
|
||||
|
||||
OutdoorPvPMgr* OutdoorPvPMgr::instance()
|
||||
@@ -24,7 +24,7 @@ OutdoorPvPMgr* OutdoorPvPMgr::instance()
|
||||
|
||||
void OutdoorPvPMgr::Die()
|
||||
{
|
||||
//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Deleting OutdoorPvPMgr");
|
||||
//LOG_DEBUG("outdoorpvp", "Deleting OutdoorPvPMgr");
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
delete *itr;
|
||||
|
||||
@@ -41,8 +41,8 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outErrorDb(">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
|
||||
sLog->outString();
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
|
||||
LOG_INFO("server", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
|
||||
if (typeId >= MAX_OUTDOORPVP_TYPES)
|
||||
{
|
||||
sLog->outErrorDb("Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
|
||||
LOG_ERROR("sql.sql", "Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -79,20 +79,20 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
OutdoorPvPDataMap::iterator iter = m_OutdoorPvPDatas.find(OutdoorPvPTypes(i));
|
||||
if (iter == m_OutdoorPvPDatas.end())
|
||||
{
|
||||
sLog->outErrorDb("Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
|
||||
LOG_ERROR("sql.sql", "Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
|
||||
continue;
|
||||
}
|
||||
|
||||
pvp = sScriptMgr->CreateOutdoorPvP(iter->second);
|
||||
if (!pvp)
|
||||
{
|
||||
sLog->outError("Could not initialize OutdoorPvP object for type ID %u; got nullptr pointer from script.", uint32(i));
|
||||
LOG_ERROR("server", "Could not initialize OutdoorPvP object for type ID %u; got nullptr pointer from script.", uint32(i));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!pvp->SetupOutdoorPvP())
|
||||
{
|
||||
sLog->outError("Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
|
||||
LOG_ERROR("server", "Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
|
||||
delete pvp;
|
||||
continue;
|
||||
}
|
||||
@@ -100,8 +100,8 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
m_OutdoorPvPSet.push_back(pvp);
|
||||
}
|
||||
|
||||
sLog->outString(">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
LOG_INFO("server", ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP* handle)
|
||||
@@ -122,7 +122,7 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
|
||||
|
||||
itr->second->HandlePlayerEnterZone(player, zoneid);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
|
||||
LOG_DEBUG("outdoorpvp", "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
|
||||
|
||||
itr->second->HandlePlayerLeaveZone(player, zoneid);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
|
||||
LOG_DEBUG("outdoorpvp", "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user