org.eigenbase.trace
Class EigenbaseLogger
java.lang.Object
org.eigenbase.trace.EigenbaseLogger
public class EigenbaseLogger
- extends Object
This class is a small extension to Logger
. Logger.log(Level
level, String msg, Object[] params)
is expensive to call, since the caller
must always allocate and fill in the array params
, even when
level
will prevent a message being logged. On the other hand,
Logger.log(Level level, String msg)
and Logger.log(Level
level, String msg, Object)
do not have this problem. As a workaround this
class provides log(Level, String msg, Object, Object)
etc. (The
varargs feature of java 1.5 half-solves this problem, by automatically
wrapping args in an array, but it does so without testing the level.) Usage:
replace: static final Logger tracer =
EigenbaseTracer.getMyTracer();
by: static final EigenbaseLogger
tracer = new EigenbaseLogger(EigenbaseTracer.getMyTracer());
Method Summary |
void |
config(String msg)
|
void |
fine(String msg)
|
void |
finer(String msg)
|
void |
finest(String msg)
|
Logger |
getLogger()
|
void |
info(String msg)
|
void |
log(Level level,
String msg)
|
void |
log(Level level,
String msg,
Object param1)
|
void |
log(Level level,
String msg,
Object[] params)
|
void |
log(Level level,
String msg,
Object arg1,
Object arg2)
Conditionally logs a message with two Object parameters |
void |
log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3)
Conditionally logs a message with three Object parameters |
void |
log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Conditionally logs a message with four Object parameters |
void |
log(Level level,
String msg,
Throwable thrown)
|
void |
severe(String msg)
|
void |
warning(String msg)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final Logger logger
EigenbaseLogger
public EigenbaseLogger(Logger logger)
log
public void log(Level level,
String msg,
Object arg1,
Object arg2)
- Conditionally logs a message with two Object parameters
log
public void log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3)
- Conditionally logs a message with three Object parameters
log
public void log(Level level,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
- Conditionally logs a message with four Object parameters
getLogger
public Logger getLogger()
log
public void log(Level level,
String msg)
log
public void log(Level level,
String msg,
Object param1)
log
public void log(Level level,
String msg,
Object[] params)
log
public void log(Level level,
String msg,
Throwable thrown)
severe
public void severe(String msg)
warning
public void warning(String msg)
info
public void info(String msg)
config
public void config(String msg)
fine
public void fine(String msg)
finer
public void finer(String msg)
finest
public void finest(String msg)