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:
parent
ff8065eaca
commit
b302c604ab
17
src/log.c
17
src/log.c
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user