@ SuppressWarnings ( { "checkstyle:returncount" , "checkstyle:cyclomaticcomplexity" } ) public static Level parseLoggingLevel ( String level ) { if ( level == null ) { return Level . INFO ; } switch ( level . toLowerCase ( ) ) { case "none" : //$NON-NLS-1$ case "false" : //$NON-NLS-1$ case "0" : //$NON-NLS-1$ return Level . OFF ; case "severe" : //$NON-NLS-1$ case "error" : //$NON-NLS-1$ case "1" : //$NON-NLS-1$ return Level . SEVERE ; case "warn" : //$NON-NLS-1$ case "warning" : //$NON-NLS-1$ case "2" : //$NON-NLS-1$ return Level . WARNING ; case "info" : //$NON-NLS-1$ case "true" : //$NON-NLS-1$ case "3" : //$NON-NLS-1$ return Level . INFO ; case "fine" : //$NON-NLS-1$ case "config" : //$NON-NLS-1$ case "4" : //$NON-NLS-1$ return Level . FINE ; case "finer" : //$NON-NLS-1$ case "5" : //$NON-NLS-1$ return Level . FINER ; case "finest" : //$NON-NLS-1$ case "debug" : //$NON-NLS-1$ case "6" : //$NON-NLS-1$ return Level . FINEST ; case "all" : //$NON-NLS-1$ case "7" : //$NON-NLS-1$ return Level . ALL ; default : try { return fromInt ( Integer . parseInt ( level ) ) ; } catch ( Throwable exception ) { // } return Level . INFO ; } }
Extract the logging level from the given string .