1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-27 20:30:13 -04:00

Display log level information in preferences

This commit is contained in:
Michael Vetter 2022-06-22 12:59:50 +02:00
parent ff8065eaca
commit b302c604ab
3 changed files with 22 additions and 0 deletions

View File

@ -225,6 +225,23 @@ log_level_from_string(char* log_level)
} }
} }
const char*
log_string_from_level(log_level_t level)
{
switch (level) {
case PROF_LEVEL_ERROR:
return "ERROR";
case PROF_LEVEL_WARN:
return "WARN";
case PROF_LEVEL_INFO:
return "INFO";
case PROF_LEVEL_DEBUG:
return "DEBUG";
default:
return "LOG";
}
}
static void static void
_rotate_log_file(void) _rotate_log_file(void)
{ {

View File

@ -63,6 +63,7 @@ void log_warning(const char* const msg, ...);
void log_error(const char* const msg, ...); void log_error(const char* const msg, ...);
void log_msg(log_level_t level, const char* const area, const char* const msg); void log_msg(log_level_t level, const char* const area, const char* const msg);
log_level_t log_level_from_string(char* log_level); log_level_t log_level_from_string(char* log_level);
const char* log_string_from_level(log_level_t level);
void log_stderr_init(log_level_t level); void log_stderr_init(log_level_t level);
void log_stderr_close(void); void log_stderr_close(void);

View File

@ -2018,6 +2018,10 @@ cons_log_setting(void)
cons_show("Shared log (/log shared) : ON"); cons_show("Shared log (/log shared) : ON");
else else
cons_show("Shared log (/log shared) : OFF"); cons_show("Shared log (/log shared) : OFF");
log_level_t filter = log_get_filter();
const gchar *level = log_string_from_level(filter);
cons_show("Log level (/log level) : %s", level);
} }
void void