Removed platform code, refactored logging to account for it and removed logging global var.

This commit is contained in:
KimLS
2020-01-06 18:15:55 -08:00
parent 4e8aec136e
commit a162313355
39 changed files with 343 additions and 645 deletions
+1 -1
View File
@@ -495,7 +495,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings *log_settings)
* If we go through this whole loop and nothing is set to any debug level, there is no point to create a file or keep anything open
*/
if (log_settings[log_category_id].log_to_file > 0) {
LogSys.file_logs_enabled = true;
EQEmuLogSys::Get()->file_logs_enabled = true;
}
categories_in_database[log_category_id] = 1;
+4 -7
View File
@@ -22,7 +22,6 @@
#include "../common/opcodemgr.h"
#include "../common/rulesys.h"
#include "../common/servertalk.h"
#include "../common/platform.h"
#include "../common/crash.h"
#include "../common/event/event_loop.h"
#include "../common/timer.h"
@@ -40,15 +39,13 @@ LFGuildManager lfguildmanager;
std::string WorldShortName;
const queryservconfig *Config;
WorldServer *worldserver = 0;
EQEmuLogSys LogSys;
void CatchSignal(int sig_num) {
RunLoops = false;
}
int main() {
RegisterExecutablePlatform(ExePlatformQueryServ);
LogSys.LoadLogSettingsDefaults();
EQEmuLogSys::Get()->LoadLogSettingsDefaults("queryserv");
set_exception_handler();
Timer LFGuildExpireTimer(60000);
@@ -75,8 +72,8 @@ int main() {
}
/* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings);
LogSys.StartFileLogs();
database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
EQEmuLogSys::Get()->StartFileLogs();
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
LogInfo("Could not set signal handler");
@@ -102,7 +99,7 @@ int main() {
EQ::EventLoop::Get().Process();
Sleep(5);
}
LogSys.CloseFileLogs();
EQEmuLogSys::Get()->CloseFileLogs();
}
void UpdateWindowTitle(char* iNewTitle) {