Merge pull request #2157 from keszybz/manager-status

Manager status
This commit is contained in:
Daniel Mack 2015-12-15 15:57:19 +01:00
commit 523f8874c6
2 changed files with 9 additions and 5 deletions

View file

@ -229,7 +229,10 @@ static int property_set_log_level(
if (r < 0)
return r;
return log_set_max_level_from_string(t);
r = log_set_max_level_from_string(t);
if (r == 0)
log_info("Setting log level to %s.", t);
return r;
}
static int property_get_n_names(

View file

@ -1885,23 +1885,21 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
switch (sfsi.ssi_signo - SIGRTMIN) {
case 20:
log_debug("Enabling showing of status.");
manager_set_show_status(m, SHOW_STATUS_YES);
break;
case 21:
log_debug("Disabling showing of status.");
manager_set_show_status(m, SHOW_STATUS_NO);
break;
case 22:
log_set_max_level(LOG_DEBUG);
log_notice("Setting log level to debug.");
log_info("Setting log level to debug.");
break;
case 23:
log_set_max_level(LOG_INFO);
log_notice("Setting log level to info.");
log_info("Setting log level to info.");
break;
case 24:
@ -2961,6 +2959,9 @@ void manager_set_show_status(Manager *m, ShowStatus mode) {
if (m->running_as != MANAGER_SYSTEM)
return;
if (m->show_status != mode)
log_debug("%s showing of status.",
mode == SHOW_STATUS_NO ? "Disabling" : "Enabling");
m->show_status = mode;
if (mode > 0)