Some adjustments to file writing routines

This commit is contained in:
Akkadius 2015-01-20 04:10:39 -06:00
parent 8b096e65af
commit cdde408602
2 changed files with 12 additions and 0 deletions

View File

@ -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;
}
}
}

View File

@ -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;