Inspectopedia
 
2024.3

Use of 'System.out' or 'System.err'

Info
New
Last modified: 03 December 2024

Reports usages of System.out or System.err.

Such statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust logging facility.

The provided quick-fix supports SLF4J and Log4j 2. It replaces System.out and System.err calls with log calls

Example:

After the quick-fix is applied:

Use the Log method for 'System.err' option to specify a method which it is used to log a message for 'System.err' calls. Use the Log method for 'System.out' option to specify a method which it is used to log a message for 'System.out' calls.