Java examples for Java Virtual Machine:Logger
Minimizing the Impact of Logging Code
import java.util.logging.Level; import java.util.logging.Logger; public class Main { public static void main(String[] args) throws Exception { int count = 123; Logger logger = Logger.getLogger("com.mycompany.MyClass"); logger.finest("count: " + count); if (logger.isLoggable(Level.FINEST)) { logger.finest("count: " + count); }/*www . j av a 2 s . co m*/ } }