code: public static void logException( Logger logger, Level logLevel, Throwable t, String message ) {
  
  		if( logger.isLoggable( logLevel )) {
  			StringBuilder sb = new StringBuilder();
  			if( message != null ) {
  				sb.append( message );
  				sb.append( "\n" );
  			}
  
  			sb.append( writeExceptionButDoNotUseItForLogging( t ));
  			logger.log( logLevel, sb.toString());
  		}
  	}
docs: Logs an exception with the given logger and the given level.
  <p>
  Writing a stack trace may be time-consuming in some environments.
  To prevent useless computing, this method checks the current log level
  before trying to log anything.
  </p>
  
  @param logger the logger
  @param t an exception or a throwable
  @param logLevel the log level (see {@link Level})
  @param message a message to insert before the stack trace