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());| Constructor and Description |
|---|
CalciteLogger(org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String format,
Object... args) |
void |
debug(String format,
@Nullable Object arg1,
@Nullable Object arg2)
Logs a DEBUG message with two Object parameters.
|
void |
debug(String format,
@Nullable Object arg1,
@Nullable Object arg2,
@Nullable Object arg3)
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.
|
org.slf4j.Logger |
getLogger() |
void |
info(String msg) |
void |
info(String format,
Object... args) |
void |
info(String format,
@Nullable Object arg1,
@Nullable Object arg2)
Logs an INFO message with two Object parameters.
|
void |
info(String format,
@Nullable Object arg1,
@Nullable Object arg2,
@Nullable Object arg3)
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 |
trace(String format,
Object... args) |
void |
trace(String format,
@Nullable Object arg1,
@Nullable Object arg2)
Logs a TRACE message with two Object parameters.
|
void |
trace(String format,
@Nullable Object arg1,
@Nullable Object arg2,
@Nullable Object arg3)
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 |
warn(String msg) |
void |
warn(String format,
Object... args) |
void |
warn(String format,
@Nullable Object arg1,
@Nullable Object arg2)
Logs a WARN message with two Object parameters.
|
void |
warn(String format,
@Nullable Object arg1,
@Nullable Object arg2,
@Nullable Object arg3)
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.
|
public void warn(String format, @Nullable Object arg1, @Nullable Object arg2)
public void warn(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3)
public void warn(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4)
public void info(String format, @Nullable Object arg1, @Nullable Object arg2)
public void info(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3)
public void info(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4)
public void debug(String format, @Nullable Object arg1, @Nullable Object arg2)
public void debug(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3)
public void debug(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4)
public void trace(String format, @Nullable Object arg1, @Nullable Object arg2)
public void trace(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3)
public void trace(String format, @Nullable Object arg1, @Nullable Object arg2, @Nullable Object arg3, @Nullable Object arg4)
public org.slf4j.Logger getLogger()
public void warn(String msg)
public void info(String msg)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.