System.out.println( ) is a luxury afforded only for hobby projects.  They have no place in shared projects that will one day become a production application.  Most customers will quite rightly demand that System.out.printlns( ) be removed from production code altogether.

Worse, println( ) rarely has context to tell where the text came from and looks unprofessional when it can't be switched off.  Stick to standard Java logging, and you can then choose to write to Log4J or not using an appropriate appender.

import java.util.logging.Level;
import java.util.logging.Logger;

public class MyClass
{
    protected final static Logger log = Logger.getLogger(MyClass.class.getName());
    :
    public void process()
    {
        if (!configured)
            log.warning("Not configured – will configure automatically");
        :
blog comments powered by Disqus