code: static public int toLevel(String level, int def) {
          if (level.equalsIgnoreCase("INFO")) {
              return LogService.LOG_INFO;
          } else if (level.equalsIgnoreCase("DEBUG")) {
              return LogService.LOG_DEBUG;
          } else if (level.equalsIgnoreCase("WARNING")) {
              return LogService.LOG_WARNING;
          } else if (level.equalsIgnoreCase("ERROR")) {
              return LogService.LOG_ERROR;
          } else if (level.equalsIgnoreCase("DEFAULT")) {
              return 0;
          }
          return def;
      }
docs: * Converts a string representing a log severity level to an int. * *
  
  @param level
  The string to convert. *
  @param def
  Default value to use if the string is not * recognized as a
  log level. *
  @return the log level, or the default value if the string can * not be
  recognized.