ca.uhn.log
Interface HapiLog

All Superinterfaces:
org.slf4j.Logger
All Known Implementing Classes:
HapiLogImpl

Deprecated. use slf4j Logger directly

public interface HapiLog
extends org.slf4j.Logger

Instantiate using HapiLogFactory#getLog( Class clazz) or HapiLogFactory#getLog( String name)

  USASE PATTERN:
  (look at the jakarta-commons-logging and log4j documentation first)
 
      ...
      import ca.uhn.log.*;
      ...
      class A {
          private static final HapiLog log = HapiLogFactory.getHapiLog( A.class );
 
          public boolean methodA( Object param1 ) {
              boolean retVal = true;
 
              //log debug messages (to be printed only when the debug mode is specified
              //in the configuration file)
              log.debug( "param1 = " + param1 );
              
              Object copy = null;
              try {
                  copy = param1.clone();
              }
              catch( CloneNotSupportedException e ) {
                  //log the error
                  log.error( "param1 must be cloneable", e );
                  retVal = false;
              }
 
              log.debug( "retVal = " + retVal );
              return retVal;
          }
 
          ...
 
      }
 

Author:
Alexei Guevara

Field Summary
 
Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME
 
Method Summary
 void error(Exception e)
          Deprecated. not available in sl4j. Use Logger.error(String, Throwable)
 
Methods inherited from interface org.slf4j.Logger
debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, error, error, getName, info, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn
 

Method Detail

error

void error(Exception e)
Deprecated. not available in sl4j. Use Logger.error(String, Throwable)



Copyright © 2001-2012 University Health Network. All Rights Reserved.