summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
authorDmitrij Tejblum <tejblum@yandex-team.ru>2011-09-21 17:41:41 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2011-09-27 21:45:53 +0400
commit51abba509a0997f05427a8acbe74dd07d8d6026e (patch)
treec9f19fc4eaf2aa01d96bde18b9ec09f1b92724e4 /lib/log.c
parenteda3529e9cf163ccbcf47c889b16fd707d2aed76 (diff)
lib: provide more information in case of failed LOOKUP.
* log.[ch] * mes_lookup: add a parameter with the name of the message list, print the name in case of failure. * LOOKUP macro: pass the name of the message list.
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/log.c b/lib/log.c
index 8a7e5f3a..4afe9229 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -774,7 +774,8 @@ lookup (const struct message *mes, int key)
* provided otherwise.
*/
const char *
-mes_lookup (const struct message *meslist, int max, int index, const char *none)
+mes_lookup (const struct message *meslist, int max, int index,
+ const char *none, const char *mesname)
{
int pos = index - meslist[0].key;
@@ -797,13 +798,13 @@ mes_lookup (const struct message *meslist, int max, int index, const char *none)
{
const char *str = (meslist->str ? meslist->str : none);
- zlog_debug ("message index %d [%s] found in position %d (max is %d)",
- index, str, i, max);
+ zlog_debug ("message index %d [%s] found in %s at position %d (max is %d)",
+ index, str, mesname, i, max);
return str;
}
}
}
- zlog_err("message index %d not found (max is %d)", index, max);
+ zlog_err("message index %d not found in %s (max is %d)", index, mesname, max);
assert (none);
return none;
}