View Javadoc

1   /*
2    * HapiLog.java
3    * 
4    * Created on May 7, 2003 at 3:53:44 PM
5    */
6   package ca.uhn.log;
7   
8   import org.slf4j.Logger;
9   
10  /**
11   * 
12   * Instantiate using {@link HapiLogFactory#getLog( Class clazz)}
13   * or {@link HapiLogFactory#getLog( String name)}
14   * 
15   * <pre>
16   *  USASE PATTERN:
17   *  (look at the jakarta-commons-logging and log4j documentation first)
18   * 
19   *      ...
20   *      import ca.uhn.log.*;
21   *      ...
22   *      class A {
23   *          private static final HapiLog log = HapiLogFactory.getHapiLog( A.class );
24   * 
25   *          public boolean methodA( Object param1 ) {
26   *              boolean retVal = true;
27   * 
28   *              //log debug messages (to be printed only when the debug mode is specified
29   *              //in the configuration file)
30   *              log.debug( "param1 = " + param1 );
31   *              
32   *              Object copy = null;
33   *              try {
34   *                  copy = param1.clone();
35   *              }
36   *              catch( CloneNotSupportedException e ) {
37   *                  //log the error
38   *                  log.error( "param1 must be cloneable", e );
39   *                  retVal = false;
40   *              }
41   * 
42   *              log.debug( "retVal = " + retVal );
43   *              return retVal;
44   *          }
45   * 
46   *          ...
47   * 
48   *      }
49   * </pre>
50   * 
51   * @author <a href="mailto:alexei.guevara@uhn.on.ca">Alexei Guevara</a>
52   * @deprecated use slf4j Logger directly
53   */
54  public interface HapiLog extends Logger {
55  
56  	/**
57  	 * @deprecated not available in sl4j. Use {@link #error(String, Throwable)}
58  	 */
59  	void error(Exception e);
60  
61  }