mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-05 21:52:26 +00:00
Some adjustments to file writing routines
This commit is contained in:
parent
8b096e65af
commit
cdde408602
@ -4171,11 +4171,22 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){
|
|||||||
"logsys_categories "
|
"logsys_categories "
|
||||||
"ORDER BY log_category_id";
|
"ORDER BY log_category_id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
int log_category = 0;
|
int log_category = 0;
|
||||||
|
log_settings.file_logs_enabled = false;
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
log_category = atoi(row[0]);
|
log_category = atoi(row[0]);
|
||||||
log_settings[log_category].log_to_console = atoi(row[2]);
|
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_file = atoi(row[3]);
|
||||||
log_settings[log_category].log_to_gmsay = atoi(row[4]);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,6 +142,7 @@ public:
|
|||||||
LogSettings log_settings[Logs::LogCategory::MaxCategoryID];
|
LogSettings log_settings[Logs::LogCategory::MaxCategoryID];
|
||||||
|
|
||||||
bool log_settings_loaded = false;
|
bool log_settings_loaded = false;
|
||||||
|
bool file_logs_enabled = false;
|
||||||
|
|
||||||
int log_platform = 0;
|
int log_platform = 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user