Backport logging from debug.cpp EQEmuLog::write back to EQEmuLogSys::WriteZoneLog

Logs being written to logs/zone/ currently
This commit is contained in:
Akkadius
2015-01-10 03:44:49 -06:00
parent 80d11d4ca9
commit 2aacc7323e
3 changed files with 37 additions and 71 deletions
+8
View File
@@ -43,6 +43,8 @@
#include "../common/eqemu_exception.h"
#include "../common/spdat.h"
#include "../common/eqemu_logsys.h"
#include "zone_config.h"
#include "masterentity.h"
#include "worldserver.h"
@@ -69,6 +71,7 @@
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include <ctime>
#ifdef _CRTDBG_MAP_ALLOC
#undef new
@@ -100,6 +103,7 @@ TitleManager title_manager;
QueryServ *QServ = 0;
TaskManager *taskmanager = 0;
QuestParserCollection *parse = 0;
EQEmuLogSys log_sys;
const SPDat_Spell_Struct* spells;
void LoadSpells(EQEmu::MemoryMappedFile **mmf);
@@ -351,6 +355,10 @@ int main(int argc, char** argv) {
if (!eqsf.IsOpen() && Config->ZonePort!=0) {
_log(ZONE__INIT, "Starting EQ Network server on port %d",Config->ZonePort);
// log_sys.CloseZoneLogs();
// log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
if (!eqsf.Open(Config->ZonePort)) {
_log(ZONE__INIT_ERR, "Failed to open port %d",Config->ZonePort);
ZoneConfig::SetZonePort(0);
+20 -2
View File
@@ -35,6 +35,7 @@
#include "../common/rulesys.h"
#include "../common/seperator.h"
#include "../common/string_util.h"
#include "../common/eqemu_logsys.h"
#include "client_logs.h"
#include "guild_mgr.h"
@@ -52,12 +53,18 @@
#include "zone.h"
#include "zone_config.h"
#include <time.h>
#include <ctime>
#include <iostream>
#ifdef _WINDOWS
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
extern bool staticzone;
extern NetConnection net;
extern PetitionList petition_list;
@@ -124,7 +131,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
zone->tradevar = 0;
zone->lootvar = 0;
}
}
}
ZoneLoaded = true;
@@ -132,7 +139,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
if(iInstanceID != 0)
{
ServerPacket *pack = new ServerPacket(ServerOP_AdventureZoneData, sizeof(uint16));
*((uint16*)pack->pBuffer) = iInstanceID;
*((uint16*)pack->pBuffer) = iInstanceID;
worldserver.SendPacket(pack);
delete pack;
}
@@ -143,6 +150,15 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
UpdateWindowTitle();
zone->GetTimeSync();
/* Set Logging */
log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
clock_t t = std::clock(); /* Function timer start */
uint64 i = 0;
log_sys.WriteZoneLog(1, "This is some serious shit");
return true;
}
@@ -708,6 +724,8 @@ void Zone::Shutdown(bool quite)
entity_list.ClearAreas();
parse->ReloadQuests(true);
UpdateWindowTitle();
log_sys.CloseZoneLogs();
}
void Zone::LoadZoneDoors(const char* zone, int16 version)