public List < LogRecord > filter ( Severity severity , String text ) { final List < LogRecord > records = new ArrayList <> ( ) ; for ( LogRecord record : this . records ) { if ( record . getSeverity ( ) . ordinal ( ) >= severity . ordinal ( ) && record . getMessage ( ) . contains ( text ) ) records . add ( record ) ; } return records ; }
Returns LogRecords that are equal or above the severity level and whose message contains text .