private String format ( String message , Object [ ] params ) { if ( params . length == 0 ) { return message ; } else if ( params . length == 1 && params [ 0 ] instanceof Throwable ) { // We print only the message here since breaking exception will bubble up // anyway return message + ": " + params [ 0 ] . toString ( ) ; } else { return String . format ( message , params ) ; } }
Use parameters when given otherwise we use the string directly