feat: make /log level work with non-default files
This commit is contained in:
@@ -6271,10 +6271,11 @@ cmd_log(ProfWin* window, const char* const command, gchar** args)
|
||||
if (strcmp(subcmd, "level") == 0) {
|
||||
log_level_t prof_log_level;
|
||||
if (log_level_from_string(value, &prof_log_level) == 0) {
|
||||
auto_char char* log_file = strdup(get_log_file_location());
|
||||
log_close();
|
||||
log_init(prof_log_level, NULL);
|
||||
log_init(prof_log_level, log_file);
|
||||
|
||||
cons_show("Log level changed to: %s.", value);
|
||||
cons_show("Log level changed to: %s (log file: %s).", value, log_file ? log_file : "[default]");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user