public static Level toLevel(String sArg, Level defaultLevel) {
        if (sArg == null)
            return defaultLevel;

        String s = sArg.toUpperCase();

        if (s.equals("ALL"))
            return Level.ALL;
        if (s.equals("DEBUG"))
            return Level.DEBUG;
        if (s.equals("INFO"))
            return Level.INFO;
        if (s.equals("WARN"))
            return Level.WARN;
        if (s.equals("ERROR"))
            return Level.ERROR;
        if (s.equals("FATAL"))
            return Level.FATAL;
        if (s.equals("OFF"))
            return Level.OFF;
        if (s.equals("TRACE"))
            return Level.TRACE;
        return defaultLevel;
    }
Convert the string passed as argument to a level. If the conversion fails,
then this method returns the value of <code>defaultLevel</code>.

@param sArg a string 
@param defaultLevel a default level
@return corresponding level
log4j-over-slf4j/src/main/java/org/apache/log4j/Level.java