diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-10-11 10:01:27 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-10-11 10:01:27 +0200 |
commit | c2af879f64bac393df12e593b1bf16cd56517095 (patch) | |
tree | 615248654ee7771688a016708fa534e52821f002 /pingu_host.c | |
parent | 47d7324b1d92e0a7614a17561e5c2f58b4b466a1 (diff) | |
download | pingu-c2af879f64bac393df12e593b1bf16cd56517095.tar.bz2 pingu-c2af879f64bac393df12e593b1bf16cd56517095.tar.xz |
pingu_host: use ONLINE/OFFLINE in log message
Diffstat (limited to 'pingu_host.c')
-rw-r--r-- | pingu_host.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pingu_host.c b/pingu_host.c index afb4dd7..c153e3d 100644 --- a/pingu_host.c +++ b/pingu_host.c @@ -45,7 +45,7 @@ void execute_action(const char *action) int pingu_host_set_status(struct pingu_host *host, int status) { - const char *action; + const char *action, *statusstr = ""; int adjustment; host->burst.active = 0; if (host->status == status) { @@ -53,17 +53,19 @@ int pingu_host_set_status(struct pingu_host *host, int status) return status; } host->status = status; - log_info("%s: new status: %i", host->label, status); switch (host->status) { case PINGU_HOST_STATUS_OFFLINE: action = host->down_action; adjustment = -1; + statusstr = "OFFLINE"; break; case PINGU_HOST_STATUS_ONLINE: action = host->up_action; adjustment = 1; + statusstr = "ONLINE"; break; } + log_info("%s: went %s", host->label, statusstr); execute_action(action); pingu_iface_adjust_hosts_online(host->iface, adjustment); |