/*
- * Copyright (C) 2004-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2004-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
*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;
+}