*value = tmp;
return 1;
}
+
+int get_loglevel_by_name(const char *txt)
+{
+ if (!strcasecmp(txt, "debug"))
+ return LL_DEBUG;
+ if (!strcasecmp(txt, "info"))
+ return LL_INFO;
+ if (!strcasecmp(txt, "notice"))
+ return LL_NOTICE;
+ if (!strcasecmp(txt, "warning"))
+ return LL_WARNING;
+ if (!strcasecmp(txt, "error"))
+ return LL_ERROR;
+ if (!strcasecmp(txt, "crit"))
+ return LL_CRIT;
+ if (!strcasecmp(txt, "emerg"))
+ return LL_EMERG;
+ return -1;
+}