diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index e9b20605..ab779075 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -1902,9 +1902,9 @@ static const struct cmd_t command_defs[] = { CMD_ARGS( { "where", "Show the current log file location." }, { "rotate on|off", "Rotate log, default on. Does not take effect if you specified a filename yourself when starting Profanity." }, - { "maxsize ", "With rotate enabled, specifies the max log size, defaults to 10485760 (10MB)." }, + { "maxsize ", "With rotate enabled, specifies the max log size, defaults to 10485760 (10MiB)." }, { "shared on|off", "Share logs between all instances, default: on. When off, the process id will be included in the log filename. Does not take effect if you specified a filename yourself when starting Profanity." }, - {"level INFO|DEBUG|WARN|ERROR", "Set the log level. Default is INFO. Only works with default log file, not with user provided log file during startup via -f." }) + { "level INFO|DEBUG|WARN|ERROR", "Set the log level. Default is INFO." }) }, { CMD_PREAMBLE("/carbons", diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index ee7fd4a2..d1af29be 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -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; } } diff --git a/src/log.c b/src/log.c index 63f82ec8..e6d10a71 100644 --- a/src/log.c +++ b/src/log.c @@ -186,7 +186,7 @@ log_error(const char* const msg, ...) } void -log_init(log_level_t filter, char* log_file) +log_init(log_level_t filter, const char* const log_file) { level_filter = filter; diff --git a/src/log.h b/src/log.h index d40d1889..6da8ebcc 100644 --- a/src/log.h +++ b/src/log.h @@ -50,7 +50,7 @@ typedef enum { PROF_LEVEL_ERROR } log_level_t; -void log_init(log_level_t filter, char* log_file); +void log_init(log_level_t filter, const char* const log_file); log_level_t log_get_filter(void); void log_close(void); const gchar* get_log_file_location(void);