Package org.apache.calcite.util.trace
Class CalciteLogger
java.lang.Object
org.apache.calcite.util.trace.CalciteLogger
Small extension to
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());
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Logs a DEBUG message with two Object parameters.void
Conditionally logs a DEBUG message with three Object parameters.void
debug
(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs a DEBUG message with four Object parameters.void
org.slf4j.Logger
void
void
Logs an INFO message with two Object parameters.void
Conditionally logs an INFO message with three Object parameters.void
info
(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs an INFO message with four Object parameters.void
void
void
Logs a TRACE message with two Object parameters.void
Conditionally logs a TRACE message with three Object parameters.void
trace
(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs a TRACE message with four Object parameters.void
void
Logs a WARN message with two Object parameters.void
Conditionally logs a WARN message with three Object parameters.void
warn
(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs a WARN message with four Object parameters.void
-
Constructor Details
-
CalciteLogger
public CalciteLogger(org.slf4j.Logger logger)
-
-
Method Details
-
warn
Logs a WARN message with two Object parameters. -
warn
public void warn(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3) Conditionally logs a WARN message with three Object parameters. -
warn
public void warn(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs a WARN message with four Object parameters. -
warn
-
info
Logs an INFO message with two Object parameters. -
info
public void info(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3) Conditionally logs an INFO message with three Object parameters. -
info
public void info(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs an INFO message with four Object parameters. -
info
-
debug
Logs a DEBUG message with two Object parameters. -
debug
public void debug(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3) Conditionally logs a DEBUG message with three Object parameters. -
debug
public void debug(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs a DEBUG message with four Object parameters. -
debug
-
trace
Logs a TRACE message with two Object parameters. -
trace
public void trace(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3) Conditionally logs a TRACE message with three Object parameters. -
trace
public void trace(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4) Conditionally logs a TRACE message with four Object parameters. -
trace
-
getLogger
public org.slf4j.Logger getLogger() -
warn
-
info
-