urbanairship-core/src/main/java/com/urbanairship/Logger.java
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    static int parseLogLevel(String value, int defaultValue) throws IllegalArgumentException {
        if (UAStringUtil.isEmpty(value)) {
            return defaultValue;
        }

        switch (value.toUpperCase(Locale.ROOT)) {
            case "ASSERT":
            case "NONE":
                return Log.ASSERT;
            case "DEBUG":
                return Log.DEBUG;
            case "ERROR":
                return Log.ERROR;
            case "INFO":
                return Log.INFO;
            case "VERBOSE":
                return Log.VERBOSE;
            case "WARN":
                return Log.WARN;
        }

        try {
            int intValue = Integer.valueOf(value);
            if (intValue <= Log.ASSERT && intValue >= Log.VERBOSE) {
                return intValue;
            }

            Logger.warn(intValue + " is not a valid log level. Falling back to " + defaultValue + ".");
            return defaultValue;
        } catch (NumberFormatException nfe) {
            throw new IllegalArgumentException("Invalid log level: " + value);
        }
    }
/**
     * Parses the log level from a String.
     *
     * @param value The log level as a String.
     * @param defaultValue Default value if the value is empty.
     * @return The log level.
     * @throws IllegalArgumentException
     * @hide
     */
Parses the log level from a String.
@param value The log level as a String.
@param defaultValue Default value if the value is empty.
@return The log level.
Parses the log level from a String . @param value The log level as a String . @param defaultValue Default value if the value is empty . @return The log level .
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    static int parseLogLevel(String value, int defaultValue) throws IllegalArgumentException {
        if (UAStringUtil.isEmpty(value)) {
            return defaultValue;
        }
        switch (value.toUpperCase(Locale.ROOT)) {
            case "ASSERT":
            case "NONE":
                return Log.ASSERT;
            case "DEBUG":
                return Log.DEBUG;
            case "ERROR":
                return Log.ERROR;
            case "INFO":
                return Log.INFO;
            case "VERBOSE":
                return Log.VERBOSE;
            case "WARN":
                return Log.WARN;
        }
        try {
            int intValue = Integer.valueOf(value);
            if (intValue <= Log.ASSERT && intValue >= Log.VERBOSE) {
                return intValue;
            }
            Logger.warn(intValue + " is not a valid log level. Falling back to " + defaultValue + ".");
            return defaultValue;
        } catch (NumberFormatException nfe) {
            throw new IllegalArgumentException("Invalid log level: " + value);
        }
    }
@ RestrictTo ( RestrictTo . Scope . LIBRARY_GROUP ) static int parseLogLevel ( String value , int defaultValue ) throws IllegalArgumentException { if ( UAStringUtil . isEmpty ( value ) ) { return defaultValue ; } switch ( value . toUpperCase ( Locale . ROOT ) ) { case "ASSERT" : case "NONE" : return Log . ASSERT ; case "DEBUG" : return Log . DEBUG ; case "ERROR" : return Log . ERROR ; case "INFO" : return Log . INFO ; case "VERBOSE" : return Log . VERBOSE ; case "WARN" : return Log . WARN ; } try { int intValue = Integer . valueOf ( value ) ; if ( intValue <= Log . ASSERT && intValue >= Log . VERBOSE ) { return intValue ; } Logger . warn ( intValue + " is not a valid log level. Falling back to " + defaultValue + "." ) ; return defaultValue ; } catch ( NumberFormatException nfe ) { throw new IllegalArgumentException ( "Invalid log level: " + value ) ; } }
Parses the log level from a String.
Parses the log level from a String .