ca.uhn.log
Interface HapiLog

All Superinterfaces:
org.apache.commons.logging.Log
All Known Implementing Classes:
HapiLogImpl

public interface HapiLog
extends org.apache.commons.logging.Log

A logging interface that enhances the Log interface with ancillary method to easy up the log messages generation by adding MessageFormat like functionality. 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;
          }
 
          ...
 
      }
 

Version:
$Revision: 1.1 $ updated on $Date: 2007/02/19 02:24:52 $ by $Author: jamesagnew $
Author:
Alexei Guevara

Method Summary
 void debug(java.lang.String msgPattern, java.lang.Object[] values, java.lang.Throwable e)
           
 
Methods inherited from interface org.apache.commons.logging.Log
debug, debug, error, error, fatal, fatal, info, info, isDebugEnabled, isErrorEnabled, isFatalEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, warn, warn
 

Method Detail

debug

void debug(java.lang.String msgPattern,
           java.lang.Object[] values,
           java.lang.Throwable e)
Parameters:
msgPattern -
values -
e -
See Also:
MessageFormat#format( ... )


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