diff --git a/common/database.cpp b/common/database.cpp index 712957f33..c0679cc48 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4171,11 +4171,22 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ "logsys_categories " "ORDER BY log_category_id"; auto results = QueryDatabase(query); + int log_category = 0; + log_settings.file_logs_enabled = false; + for (auto row = results.begin(); row != results.end(); ++row) { log_category = atoi(row[0]); log_settings[log_category].log_to_console = atoi(row[2]); log_settings[log_category].log_to_file = atoi(row[3]); log_settings[log_category].log_to_gmsay = atoi(row[4]); + + /* + This determines whether or not the process needs to actually file log anything. + 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].log_to_file > 0){ + log_settings.file_logs_enabled = true; + } } } \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d3a81e5c8..66124df74 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -142,6 +142,7 @@ public: LogSettings log_settings[Logs::LogCategory::MaxCategoryID]; bool log_settings_loaded = false; + bool file_logs_enabled = false; int log_platform = 0;