@TestClass(value="org.openscience.cdk.tools.SystemOutLoggingToolTest") public class SystemOutLoggingTool extends Object implements ILoggingTool
ILoggingTool
interface that sends output to
the System
.out channel.DEFAULT_STACK_LENGTH
Constructor and Description |
---|
SystemOutLoggingTool(Class<?> classInst)
Constructs a ILoggingTool which produces log lines indicating them to be
for the given Class.
|
Modifier and Type | Method and Description |
---|---|
static ILoggingTool |
create(Class<?> sourceClass)
Creates a new
SystemOutLoggingTool for the given class. |
void |
debug(Object object)
Shows DEBUG output for the Object.
|
void |
debug(Object object,
Object... objects)
Shows DEBUG output for the given Object's.
|
void |
dumpClasspath()
Outputs the system property for java.class.path.
|
void |
dumpSystemProperties()
Outputs system properties for the operating system and the java
version.
|
void |
error(Object object)
Shows ERROR output for the Object.
|
void |
error(Object object,
Object... objects)
Shows ERROR output for the given Object's.
|
void |
fatal(Object object)
Shows FATAL output for the Object.
|
void |
info(Object object)
Shows INFO output for the Object.
|
void |
info(Object object,
Object... objects)
Shows INFO output for the given Object's.
|
boolean |
isDebugEnabled()
Use this method for computational demanding debug info.
|
void |
setStackLength(int length)
Sets the number of StackTraceElements to be printed in DEBUG mode when
calling
debug(Throwable) . |
void |
warn(Object object)
Shows WARN output for the Object.
|
void |
warn(Object object,
Object... objects)
Shows WARN output for the given Object's.
|
@TestMethod(value="testLoggingTool_Class") public SystemOutLoggingTool(Class<?> classInst)
classInst
- Class from which the log messages originate@TestMethod(value="testDumpSystemProperties") public void dumpSystemProperties()
dumpSystemProperties
in interface ILoggingTool
@TestMethod(value="testSetStackLength_int") public void setStackLength(int length)
debug(Throwable)
.
The default value is DEFAULT_STACK_LENGTH.setStackLength
in interface ILoggingTool
length
- the new stack lengthILoggingTool.DEFAULT_STACK_LENGTH
@TestMethod(value="testDumpClasspath") public void dumpClasspath()
dumpClasspath
in interface ILoggingTool
@TestMethod(value="testDebug_Object") public void debug(Object object)
Throwable
it will output the trace. Otherwise it will use the
toString() method.debug
in interface ILoggingTool
object
- Object to apply toString() too and output@TestMethod(value="testDebug_Object_Object") public void debug(Object object, Object... objects)
debug
in interface ILoggingTool
object
- Object to apply toString() too and outputobjects
- Object... to apply toString() too and output@TestMethod(value="testError_Object") public void error(Object object)
error
in interface ILoggingTool
object
- Object to apply toString() too and output@TestMethod(value="testError_Object_int") public void error(Object object, Object... objects)
error
in interface ILoggingTool
object
- Object to apply toString() too and outputobjects
- Object... to apply toString() too and output@TestMethod(value="testFatal_Object") public void fatal(Object object)
fatal
in interface ILoggingTool
object
- Object to apply toString() too and output@TestMethod(value="testInfo_Object") public void info(Object object)
info
in interface ILoggingTool
object
- Object to apply toString() too and output@TestMethod(value="testInfo_Object_int") public void info(Object object, Object... objects)
info
in interface ILoggingTool
object
- Object to apply toString() too and outputobjects
- Object... to apply toString() too and output@TestMethod(value="testWarn_Object") public void warn(Object object)
warn
in interface ILoggingTool
object
- Object to apply toString() too and output@TestMethod(value="testWarn_Object_int") public void warn(Object object, Object... objects)
warn
in interface ILoggingTool
object
- Object to apply toString() too and outputobjects
- Object... to apply toString() too and output@TestMethod(value="testIsDebugEnabled") public boolean isDebugEnabled()
if (logger.isDebugEnabled()) { logger.info("The 1056389822th prime that is used is: ", calculatePrime(1056389822)); }
isDebugEnabled
in interface ILoggingTool
@TestMethod(value="testCreate") public static ILoggingTool create(Class<?> sourceClass)
SystemOutLoggingTool
for the given class.sourceClass
- Class for which logging messages are recorded.SystemOutLoggingTool
.