1
0
Fork 0

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
_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_msg(log_level_t level, const char* const area, const char* const msg);
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_close(void);

View File

@ -2018,6 +2018,10 @@ cons_log_setting(void)
cons_show("Shared log (/log shared) : ON");
else
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