From 714ccb9992307112689d63493fada72cf1a6224b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 21 Aug 2014 23:24:02 +0200 Subject: sysmobts: Provide information about the state transitions --- src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c index 217928a3..7407f74b 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c @@ -26,10 +26,19 @@ #include #include +#include static struct sysmobts_mgr_instance *s_mgr; static struct osmo_timer_list temp_ctrl_timer; +static const struct value_string state_names[] = { + { STATE_NORMAL, "NORMAL" }, + { STATE_WARNING_HYST, "WARNING (HYST)" }, + { STATE_WARNING, "WARNING" }, + { STATE_CRITICAL, "CRITICAL" }, + { 0, NULL } +}; + static int next_state(enum sysmobts_temp_state current_state, int critical, int warning) { int next_state = -1; @@ -93,6 +102,9 @@ static void sysmobts_mgr_temp_handle(struct sysmobts_mgr_instance *manager, if (new_state < 0) return; + LOGP(DTEMP, LOGL_NOTICE, "Moving from state %s to %s.\n", + get_value_string(state_names, manager->state), + get_value_string(state_names, new_state)); manager->state = new_state; switch (manager->state) { case STATE_NORMAL: -- cgit v1.2.3