protected static int getLevel ( String level , int defaultLogLevel ) { try { return Integer . parseInt ( level ) ; } catch ( NumberFormatException e ) { // Try to read the string. if ( "VERBOSE" . equalsIgnoreCase ( level ) ) { return Constants . VERBOSE ; } else if ( "DEBUG" . equalsIgnoreCase ( level ) ) { return Constants . DEBUG ; } else if ( "INFO" . equalsIgnoreCase ( level ) ) { return Constants . INFO ; } else if ( "WARN" . equalsIgnoreCase ( level ) ) { return Constants . WARN ; } else if ( "ERROR" . equalsIgnoreCase ( level ) ) { return Constants . ERROR ; } else if ( "ASSERT" . equalsIgnoreCase ( level ) ) { return Constants . ASSERT ; } } return defaultLogLevel ; }
Parses the given level to get the log level . This method supports both integer level and String level .