Reports calls to System.out.println() with an exception as an argument. Using print statements for logging exceptions hides the stack trace from you, which is important when you need to investigate what happened. It is recommended to use logger instead. Calls to System.out.print(), System.err.println() and System.err.print() with an exception argument are also reported. It is better to use a logger to log exceptions instead.

For example, instead of:


  try {
      foo();
  } catch (Exception e) {
      System.out.println(e);
  }

use the following code:


  try {
      foo();
  } catch (Exception e) {
      logger.warn(e); // logger call may be different
  }