public class CalciteLogger extends Object
Logger with some performance improvements.
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 =
CalciteTracer.getMyTracer();
by:
static final CalciteLogger tracer =
new CalciteLogger(CalciteTrace.getMyTracer());| Constructor and Description |
|---|
CalciteLogger(Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
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) |
public CalciteLogger(Logger logger)
public void log(Level level, String msg, Object arg1, Object arg2)
public void log(Level level, String msg, Object arg1, Object arg2, Object arg3)
public void log(Level level, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
public Logger getLogger()
public void severe(String msg)
public void warning(String msg)
public void info(String msg)
public void config(String msg)
public void fine(String msg)
public void finer(String msg)
public void finest(String msg)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.