public static void log ( final Level level , final Throwable exception , final String message ) { String nameOfException = exception . getClass ( ) . getName ( ) ; String messageOfException = exception . getMessage ( ) ; StringBuilder builder = new StringBuilder ( BUFFER_SIZE ) ; builder . append ( level ) ; builder . append ( ": " ) ; builder . append ( message ) ; builder . append ( " (" ) ; builder . append ( nameOfException ) ; if ( messageOfException != null && ! messageOfException . isEmpty ( ) ) { builder . append ( ": " ) ; builder . append ( messageOfException ) ; } builder . append ( ")" ) ; System . err . println ( builder ) ; }
Logs a caught exception with a custom text message .