Skip to content

Commit

Permalink
Allow toggling debug verbosity with SIGUSR1 and SIGUSR2
Browse files Browse the repository at this point in the history
Switch to debug verbosity with USR1 and back to warning level with USR2

[mce] Allow toggling debug verbosity with SIGUSR1 and SIGUSR2
  • Loading branch information
spiiroin committed Jan 16, 2014
1 parent e4c7ed2 commit d85c8f7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mce.c
Expand Up @@ -340,7 +340,16 @@ static void signal_handler(const gint signr)
{
switch (signr) {
case SIGUSR1:
/* We'll probably want some way to communicate with MCE */
/* switch to debug verbosity */
mce_log_set_verbosity(LL_DEBUG);
mce_log(LL_DEBUG, "switching to DEBUG verbosity level");
break;

case SIGUSR2:
/* switch to normal verbosity */
mce_log_set_verbosity(LL_DEBUG);
mce_log(LL_DEBUG, "switching to WARNING verbosity level");
mce_log_set_verbosity(LL_WARN);
break;

case SIGHUP:
Expand Down Expand Up @@ -374,6 +383,7 @@ static void install_signal_handlers(void)
{
static const int sig[] = {
SIGUSR1,
SIGUSR2,
SIGHUP,

SIGINT,
Expand Down

0 comments on commit d85c8f7

Please sign in to comment.