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
@@ -720,7 +720,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
@@ -23,7 +23,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 "database.h"
@@ -38,7 +37,6 @@
ChatChannelList *ChannelList;
Clientlist *g_Clientlist;
EQEmuLogSys LogSys;
Database database;
WorldServer *worldserver = nullptr;
@@ -63,8 +61,7 @@ std::string GetMailPrefix() {
}
int main() {
RegisterExecutablePlatform(ExePlatformUCS);
LogSys.LoadLogSettingsDefaults();
EQEmuLogSys::Get()->LoadLogSettingsDefaults("ucs");
set_exception_handler();
// Check every minute for unused channels we can delete
@@ -97,8 +94,8 @@ int main() {
}
/* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings);
LogSys.StartFileLogs();
database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
EQEmuLogSys::Get()->StartFileLogs();
char tmp[64];
@@ -162,7 +159,7 @@ int main() {
g_Clientlist->CloseAllConnections();
LogSys.CloseFileLogs();
EQEmuLogSys::Get()->CloseFileLogs();
}