Files
openide/java/java-impl/resources/inspectionDescriptions/SystemOutErr.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

30 lines
1.0 KiB
HTML

<html>
<body>
Reports usages of <code>System.out</code> or <code>System.err</code>.
<p>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.</p>
<p>The provided quick-fix supports <b>SLF4J</b> and <b>Log4j 2</b>.
It replaces <code>System.out</code> and <code>System.err</code> calls with log calls</p>
<p><b>Example:</b></p>
<pre><code>
public static void test(Object o) {
System.out.println("Test: "+ o);
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
private static final Logger log = LoggerFactory.getLogger(Test.class);
public static void test(Object o) {
log.info("Test: {}", o);;
}
</code></pre>
<!-- tooltip end -->
<p>
Use the <b>Log method for 'System.err'</b> option to specify a method which it is used to log a message for 'System.err' calls.
Use the <b>Log method for 'System.out'</b> option to specify a method which it is used to log a message for 'System.out' calls.
</p>
</body>
</html>