public static void warnWithException ( Logger logger , String message , Object ... args ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( message , args ) ; } else { if ( args . length > 0 && args [ args . length - 1 ] instanceof Throwable ) { args [ args . length - 1 ] = ( ( Throwable ) args [ args . length - 1 ] ) . getMessage ( ) ; } logger . warn ( message + ": {}" , args ) ; } }
Log a warning message with full exception if debug logging is enabled or just the message otherwise .