+static
+char log_level_from_arg(const char *arg)
+{
+ char level = 'U';
+
+ if (strcmp(arg, "VERBOSE") == 0 ||
+ strcmp(arg, "V") == 0) {
+ level = 'V';
+ } else if (strcmp(arg, "DEBUG") == 0 ||
+ strcmp(arg, "D") == 0) {
+ level = 'D';
+ } else if (strcmp(arg, "INFO") == 0 ||
+ strcmp(arg, "I") == 0) {
+ level = 'I';
+ } else if (strcmp(arg, "WARN") == 0 ||
+ strcmp(arg, "WARNING") == 0 ||
+ strcmp(arg, "W") == 0) {
+ level = 'W';
+ } else if (strcmp(arg, "ERROR") == 0 ||
+ strcmp(arg, "E") == 0) {
+ level = 'E';
+ } else if (strcmp(arg, "FATAL") == 0 ||
+ strcmp(arg, "F") == 0) {
+ level = 'F';
+ } else if (strcmp(arg, "NONE") == 0 ||
+ strcmp(arg, "N") == 0) {
+ level = 'N';
+ }
+
+ return level;
+}
+