public class TestLogger extends Object implements Logger
Logger
that writes to ByteArrayOutputStream
and allows retrieval of
the logs via getErrContent()
and getOutContent()
. Both buffers can
be cleared with reset()
.Logger.ChoiceOfMessageSupplier
Constructor and Description |
---|
TestLogger() |
TestLogger(boolean logCurrentThreadName) |
Modifier and Type | Method and Description |
---|---|
void |
debug(String msg) |
void |
debug(String format,
Object... arguments) |
void |
debug(String msg,
Throwable t) |
void |
error(String msg) |
void |
error(String format,
Object... arguments) |
void |
error(String msg,
Throwable t) |
String |
getErrContent() |
String |
getName() |
String |
getOutContent() |
void |
info(String msg) |
void |
info(String format,
Object... arguments) |
void |
info(String msg,
Throwable t) |
boolean |
isDebugEnabled() |
boolean |
isErrorEnabled() |
boolean |
isInfoEnabled() |
boolean |
isLogCurrentThreadName() |
boolean |
isTraceEnabled() |
boolean |
isWarnEnabled() |
void |
reset() |
void |
trace(String msg) |
void |
trace(String format,
Object... arguments) |
void |
trace(String msg,
Throwable t) |
void |
warn(String msg) |
void |
warn(String format,
Object... arguments) |
void |
warn(String msg,
Throwable t) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
errorOrDebug, errorOrDebug, infoOrDebug, infoOrDebug, warnOrDebug, warnOrDebug
public TestLogger()
public TestLogger(boolean logCurrentThreadName)
public String getErrContent()
public String getOutContent()
public void reset()
public boolean isTraceEnabled()
isTraceEnabled
in interface Logger
public boolean isDebugEnabled()
isDebugEnabled
in interface Logger
public boolean isInfoEnabled()
isInfoEnabled
in interface Logger
public boolean isWarnEnabled()
isWarnEnabled
in interface Logger
public boolean isErrorEnabled()
isErrorEnabled
in interface Logger
public boolean isLogCurrentThreadName()