mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
30 lines
1.0 KiB
HTML
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> |