[Performance] Reworked how all log calls are made in the source, see changelog.txt for more details

This commit is contained in:
Akkadius
2017-04-01 03:51:46 -05:00
parent 93a6efa95f
commit 7aa1d243b0
131 changed files with 3126 additions and 3066 deletions
+11 -11
View File
@@ -40,7 +40,7 @@ LFGuildManager lfguildmanager;
std::string WorldShortName;
const queryservconfig *Config;
WorldServer *worldserver = 0;
EQEmuLogSys Log;
EQEmuLogSys LogSys;
void CatchSignal(int sig_num) {
RunLoops = false;
@@ -50,7 +50,7 @@ void CatchSignal(int sig_num) {
int main() {
RegisterExecutablePlatform(ExePlatformQueryServ);
Log.LoadLogSettingsDefaults();
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
Timer LFGuildExpireTimer(60000);
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
@@ -65,16 +65,16 @@ int main() {
</qsdatabase>
*/
Log.Out(Logs::General, Logs::QS_Server, "Starting EQEmu QueryServ.");
Log(Logs::General, Logs::QS_Server, "Starting EQEmu QueryServ.");
if (!queryservconfig::LoadConfig()) {
Log.Out(Logs::General, Logs::QS_Server, "Loading server configuration failed.");
Log(Logs::General, Logs::QS_Server, "Loading server configuration failed.");
return 1;
}
Config = queryservconfig::get();
WorldShortName = Config->ShortName;
Log.Out(Logs::General, Logs::QS_Server, "Connecting to MySQL...");
Log(Logs::General, Logs::QS_Server, "Connecting to MySQL...");
/* MySQL Connection */
if (!database.Connect(
@@ -83,20 +83,20 @@ int main() {
Config->QSDatabasePassword.c_str(),
Config->QSDatabaseDB.c_str(),
Config->QSDatabasePort)) {
Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection.");
Log(Logs::General, Logs::QS_Server, "Cannot continue without a database connection.");
return 1;
}
/* Register Log System and Settings */
database.LoadLogSettings(Log.log_settings);
Log.StartFileLogs();
database.LoadLogSettings(LogSys.log_settings);
LogSys.StartFileLogs();
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler");
Log(Logs::General, Logs::QS_Server, "Could not set signal handler");
return 1;
}
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler");
Log(Logs::General, Logs::QS_Server, "Could not set signal handler");
return 1;
}
@@ -120,7 +120,7 @@ int main() {
timeout_manager.CheckTimeouts();
Sleep(100);
}
Log.CloseFileLogs();
LogSys.CloseFileLogs();
}
void UpdateWindowTitle(char* iNewTitle) {