public interface HapiLog extends org.slf4j.Logger
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;
}
...
}
| Modifier and Type | Method and Description |
|---|---|
void |
error(Exception e)
Deprecated.
not available in sl4j. Use
Logger.error(String, Throwable) |
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, warnCopyright © 2001-2013 University Health Network. All Rights Reserved.