|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HapiLog
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; } ... }
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 |
---|
void debug(java.lang.String msgPattern, java.lang.Object[] values, java.lang.Throwable e)
msgPattern
- values
- e
- MessageFormat#format( ... )
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |