public class CalciteLogger extends Object
Logger with some performance improvements.
Logger.info(String format, Object[] params) is expensive
to call, since the caller must always allocate and fill in the array
params, even when the level will prevent a message
being logged. On the other hand, Logger.info(String msg)
and Logger.info(String msg, Object o) do not have this
problem.
As a workaround this class provides
info(String msg, Object o1, Object o2) 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());| Modifier and Type | Field and Description |
|---|---|
private org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
CalciteLogger(org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String format,
Object... args) |
void |
debug(String format,
Object arg1,
Object arg2)
Logs a DEBUG message with two Object parameters
|
void |
debug(String format,
Object arg1,
Object arg2,
Object arg3)
Conditionally logs a DEBUG message with three Object parameters
|
void |
debug(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Conditionally logs a DEBUG message with four Object parameters
|
org.slf4j.Logger |
getLogger() |
void |
info(String msg) |
void |
info(String format,
Object... args) |
void |
info(String format,
Object arg1,
Object arg2)
Logs an INFO message with two Object parameters
|
void |
info(String format,
Object arg1,
Object arg2,
Object arg3)
Conditionally logs an INFO message with three Object parameters
|
void |
info(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Conditionally logs an INFO message with four Object parameters
|
void |
trace(String format,
Object... args) |
void |
trace(String format,
Object arg1,
Object arg2)
Logs a TRACE message with two Object parameters
|
void |
trace(String format,
Object arg1,
Object arg2,
Object arg3)
Conditionally logs a TRACE message with three Object parameters
|
void |
trace(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Conditionally logs a TRACE message with four Object parameters
|
void |
warn(String msg) |
void |
warn(String format,
Object... args) |
void |
warn(String format,
Object arg1,
Object arg2)
Logs a WARN message with two Object parameters
|
void |
warn(String format,
Object arg1,
Object arg2,
Object arg3)
Conditionally logs a WARN message with three Object parameters
|
void |
warn(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Conditionally logs a WARN message with four Object parameters
|
public void warn(String format, Object arg1, Object arg2)
public void warn(String format, Object arg1, Object arg2, Object arg3)
public void warn(String format, Object arg1, Object arg2, Object arg3, Object arg4)
public void info(String format, Object arg1, Object arg2)
public void info(String format, Object arg1, Object arg2, Object arg3)
public void info(String format, Object arg1, Object arg2, Object arg3, Object arg4)
public void debug(String format, Object arg1, Object arg2)
public void debug(String format, Object arg1, Object arg2, Object arg3)
public void debug(String format, Object arg1, Object arg2, Object arg3, Object arg4)
public void trace(String format, Object arg1, Object arg2)
public void trace(String format, Object arg1, Object arg2, Object arg3)
public void trace(String format, Object arg1, Object arg2, Object arg3, Object arg4)
public org.slf4j.Logger getLogger()
public void warn(String msg)
public void info(String msg)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.