diff options
| author | Spp <spp@jorge.gr> | 2012-08-03 14:20:18 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2012-08-03 14:20:18 +0200 |
| commit | 55ce180f2867700b28921d99f9a0cb9c83330c91 (patch) | |
| tree | c563db507cce44b680996d42148185cb1512188c /src/server/game/Events/GameEventMgr.cpp | |
| parent | f85908869986eab0b645f0a697028bcceba7778c (diff) | |
Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'
Explanation of use with Sample config:
Appender.Console.Type=1 (1 = Console)
Appender.Console.Level=2 (2 = Debug)
Appender.Server.Type=2 (2 = File)
Appender.Server.Level=3 (3 = Info)
Appender.Server.File=Server.log
Appender.SQL.Type=2 (2 = File)
Appender.SQL.Level=1 (1 = Trace)
Appender.SQL.File=sql.log
Appenders=Console Server (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)
Logger.root.Type=0 (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5 (5 = Error)
Logger.root.Appenders=Console
Logger.SQL.Type=26 (26 = SQL)
Logger.SQL.Level=3 (2 = Debug)
Logger.SQL.Appenders=Console Server SQL
Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName
* At loading Appender SQL will be ignored, as it's not present on "Appenders"
* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
- Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged
* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
- Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged
* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
- Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
- Appender Console has lower Log Level: Msg is logged to Console
- Appender Server has higher Log Level: Msg is not logged to file
- Appender SQL has lower Log Level: Msg is logged to file sql.log
* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
- Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender
* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
- Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
- Appender Console has lower LogLevel: Msg is logged to Console
Diffstat (limited to 'src/server/game/Events/GameEventMgr.cpp')
| -rwxr-xr-x | src/server/game/Events/GameEventMgr.cpp | 236 |
1 files changed, 118 insertions, 118 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index d5e85d2cf2f..e1141f785e1 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -210,8 +210,8 @@ void GameEventMgr::LoadFromDB() if (!result) { mGameEvent.clear(); - sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 game events. DB table `game_event` is empty."); + return; } @@ -223,7 +223,7 @@ void GameEventMgr::LoadFromDB() uint8 event_id = fields[0].GetUInt8(); if (event_id == 0) { - sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used."); + sLog->outError(LOG_FILTER_SQL, "`game_event` game event entry 0 is reserved and can't be used."); continue; } @@ -241,7 +241,7 @@ void GameEventMgr::LoadFromDB() if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check { - sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id); continue; } @@ -249,7 +249,7 @@ void GameEventMgr::LoadFromDB() { if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) { - sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id); + sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id); pGameEvent.holiday_id = HOLIDAY_NONE; } } @@ -260,11 +260,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } - sLog->outString("Loading Game Event Saves Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Saves Data..."); { uint32 oldMSTime = getMSTime(); @@ -273,8 +273,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + } else { @@ -287,7 +287,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id); continue; } @@ -298,7 +298,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u", event_id); + sLog->outError(LOG_FILTER_SQL, "game_event_save includes event save for non-worldevent id %u", event_id); continue; } @@ -306,12 +306,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Prerequisite Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Prerequisite Data..."); { uint32 oldMSTime = getMSTime(); @@ -319,8 +319,8 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { - sLog->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + } else { @@ -333,7 +333,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -342,14 +342,14 @@ void GameEventMgr::LoadFromDB() uint16 prerequisite_event = fields[1].GetUInt32(); if (prerequisite_event >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); + sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); continue; } mGameEvent[event_id].prerequisite_events.insert(prerequisite_event); } else { - sLog->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u", event_id); + sLog->outError(LOG_FILTER_SQL, "game_event_prerequisiste includes event entry for non-worldevent id %u", event_id); continue; } @@ -357,12 +357,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Creature Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Creature Data..."); { uint32 oldMSTime = getMSTime(); @@ -372,8 +372,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + } else { @@ -389,7 +389,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -400,12 +400,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event GO Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Data..."); { uint32 oldMSTime = getMSTime(); @@ -415,8 +415,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + } else { @@ -432,7 +432,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -443,12 +443,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Model/Equipment Change Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Model/Equipment Change Data..."); { uint32 oldMSTime = getMSTime(); @@ -458,8 +458,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); + } else { @@ -473,7 +473,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventModelEquip.size()) { - sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -488,7 +488,7 @@ void GameEventMgr::LoadFromDB() { if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id)) { - sLog->outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", + sLog->outError(LOG_FILTER_SQL, "Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", guid, newModelEquipSet.equipment_id); continue; } @@ -500,12 +500,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Quest Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Data..."); { uint32 oldMSTime = getMSTime(); @@ -514,8 +514,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); + } else { @@ -530,7 +530,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventCreatureQuests.size()) { - sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -541,12 +541,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event GO Quest Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Quest Data..."); { uint32 oldMSTime = getMSTime(); @@ -555,8 +555,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); + } else { @@ -571,7 +571,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventGameObjectQuests.size()) { - sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -582,12 +582,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Quest Condition Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Condition Data..."); { uint32 oldMSTime = getMSTime(); @@ -596,8 +596,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); + } else { @@ -613,7 +613,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -625,12 +625,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Condition Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Data..."); { uint32 oldMSTime = getMSTime(); @@ -639,8 +639,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); + } else { @@ -654,7 +654,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -667,12 +667,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Condition Save Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Save Data..."); { uint32 oldMSTime = getMSTime(); @@ -681,8 +681,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); + } else { @@ -696,7 +696,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -707,7 +707,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition); + sLog->outError(LOG_FILTER_SQL, "game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition); continue; } @@ -715,12 +715,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event NPCflag Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event NPCflag Data..."); { uint32 oldMSTime = getMSTime(); @@ -729,8 +729,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); + } else { @@ -745,7 +745,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -755,12 +755,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Seasonal Quest Relations..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Seasonal Quest Relations..."); { uint32 oldMSTime = getMSTime(); @@ -769,8 +769,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); + } else { @@ -784,13 +784,13 @@ void GameEventMgr::LoadFromDB() if (!sObjectMgr->GetQuestTemplate(questId)) { - sLog->outErrorDb("`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId); + sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId); continue; } if (eventEntry >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry); + sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry); continue; } @@ -799,12 +799,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Vendor Additions Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Vendor Additions Data..."); { uint32 oldMSTime = getMSTime(); @@ -813,8 +813,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + } else { @@ -827,7 +827,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventVendors.size()) { - sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -865,12 +865,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Battleground Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Battleground Data..."); { uint32 oldMSTime = getMSTime(); @@ -879,8 +879,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); + } else { @@ -893,7 +893,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -903,12 +903,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Pool Data..."); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Pool Data..."); { uint32 oldMSTime = getMSTime(); @@ -918,8 +918,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); + } else { @@ -935,13 +935,13 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } if (!sPoolMgr->CheckPool(entry)) { - sLog->outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry); + sLog->outError(LOG_FILTER_SQL, "Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry); continue; } @@ -952,8 +952,8 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } } @@ -1015,7 +1015,7 @@ void GameEventMgr::StartArenaSeason() if (!result) { - sLog->outError("ArenaSeason (%u) must be an existant Arena Season", season); + sLog->outError(LOG_FILTER_GAMEEVENTS, "ArenaSeason (%u) must be an existant Arena Season", season); return; } @@ -1024,13 +1024,13 @@ void GameEventMgr::StartArenaSeason() if (eventId >= mGameEvent.size()) { - sLog->outError("EventEntry %u for ArenaSeason (%u) does not exists", eventId, season); + sLog->outError(LOG_FILTER_GAMEEVENTS, "EventEntry %u for ArenaSeason (%u) does not exists", eventId, season); return; } StartEvent(eventId, true); - sLog->outString("Arena Season %u started...", season); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Arena Season %u started...", season); + } uint32 GameEventMgr::Update() // return the next event delay in ms @@ -1043,7 +1043,7 @@ uint32 GameEventMgr::Update() // return the next e { // must do the activating first, and after that the deactivating // so first queue it - //sLog->outErrorDb("Checking event %u", itr); + //sLog->outError(LOG_FILTER_SQL, "Checking event %u", itr); if (CheckOneGameEvent(itr)) { // if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so @@ -1099,13 +1099,13 @@ uint32 GameEventMgr::Update() // return the next e nextEventDelay = 0; for (std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr) StopEvent(*itr); - sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Next game event check in %u seconds.", nextEventDelay + 1); return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call } void GameEventMgr::UnApplyEvent(uint16 event_id) { - sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END RunSmartAIScripts(event_id, false); // un-spawn positive event tagged objects @@ -1137,7 +1137,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) break; } - sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END RunSmartAIScripts(event_id, true); @@ -1211,7 +1211,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1238,7 +1238,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1271,7 +1271,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } @@ -1286,7 +1286,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1308,7 +1308,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1329,7 +1329,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) } if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } |
