View Javadoc
1   /*
2    * Created on Dec 12, 2004
3    */
4   package com.amowers.samples.logging;
5   
6   import org.apache.commons.logging.Log;
7   import org.apache.commons.logging.LogFactory;
8   
9   /***
10   * @todo put class comments here.
11   *
12   * @author amowers
13   *
14   */
15  public final class LogItToo {
16      private static final Log LOG = LogFactory.getLog(LogItToo.class);
17  
18      /***
19       * Everthing about this class is static therefore make the constructor
20       * private.
21       */
22      private LogItToo() {
23      }
24  
25      /***
26       * Use a few of the logging APIs.
27       */
28      public static void doSomething() {
29          LOG.info("if debugging is on for this category then");
30          LOG.info("there should follow a debug message");
31          if (!LOG.isDebugEnabled()) {
32              LOG.info("DEBUGGING IS NOT ON FOR THIS CATEGORY");
33          }
34  
35          LOG.debug("DEBUGGING IS ON FOR THIS CATEGORY");
36      }
37  }