Package de.christofreichardt.diagnosis
Class NullTracer
- java.lang.Object
-
- de.christofreichardt.diagnosis.AbstractTracer
-
- de.christofreichardt.diagnosis.NullTracer
-
- Direct Known Subclasses:
JDKLoggingRouter,Log4j2Router,LogbackRouter
public class NullTracer extends AbstractTracer
Instances of this tracer type don't trace anything and therefore need not to manage any method stacks. This fast tracer may be used at production time. Derived classes should be made final and may override the logException()- and logMessage()-methods by connecting to an alternative logging system.- Author:
- Christof Reichardt
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.christofreichardt.diagnosis.AbstractTracer
AbstractTracer.Exception
-
-
Field Summary
-
Fields inherited from class de.christofreichardt.diagnosis.AbstractTracer
VERSION
-
-
Constructor Summary
Constructors Constructor Description NullTracer()Default constructor.NullTracer(String name)Constructor for pooled tracers with (unique) names.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Pseudo close()-method.TraceMethodentry(String methodSignature)Deprecated.provided for backwards compatibilityTraceMethodentry(String returnType, Class<?> clazz, String methodSignature)Pseudo entry()-method.TraceMethodentry(String returnType, Object object, String methodSignature)Pseudo entry()-method.voidinitCurrentTracingContext()Pseudo initCurrentTracingContext()-method.voidinitCurrentTracingContext(int debugLevel, boolean online)Pseudo initCurrentTracingContext()-method.voidlogException(LogLevel logLevel, Throwable throwable, Class<?> clazz, String methodName)Pseudo logException()-method.voidlogMessage(LogLevel logLevel, String message, Class<?> clazz, String methodName)Pseudo logMessage()-method.voidopen()Pseudo open()-method.NullPrintStreamout()Returns always aNullPrintStream.protected NullPrintStreamout(int level)Returns always aNullPrintStreamregardless of the given level.protected voidreadConfiguration(XPath xpath, Node node)Pseudo readConfiguration()-method.TraceMethodwayout()Pseudo wayout()-method.-
Methods inherited from class de.christofreichardt.diagnosis.AbstractTracer
clearCurrentTracingContext, formatStreamErrorState, formatVersionInfo, getBufferedOutputStream, getBufferSize, getLevel, getName, getNullPrintStream, getThreadMap, getTracePrintStream, isAutoflush, isOnline, isOpened, setAutoflush, setBufferedOutputStream, setBufferSize, setOpened, setTracePrintStream
-
-
-
-
Constructor Detail
-
NullTracer
public NullTracer()
Default constructor.
-
NullTracer
public NullTracer(String name)
Constructor for pooled tracers with (unique) names.- Parameters:
name- the name of the tracer
-
-
Method Detail
-
readConfiguration
protected void readConfiguration(XPath xpath, Node node)
Pseudo readConfiguration()-method.- Overrides:
readConfigurationin classAbstractTracer- Parameters:
xpath- (ignored)node- (ignored)
-
open
public final void open()
Pseudo open()-method.- Specified by:
openin classAbstractTracer
-
close
public final void close()
Pseudo close()-method.- Specified by:
closein classAbstractTracer
-
out
protected final NullPrintStream out(int level)
Returns always aNullPrintStreamregardless of the given level.- Overrides:
outin classAbstractTracer- Parameters:
level- (ignored)- Returns:
- always a NullPrintStream
-
out
public final NullPrintStream out()
Returns always aNullPrintStream.- Overrides:
outin classAbstractTracer- Returns:
- a NullPrintStream
-
entry
@Deprecated public final TraceMethod entry(String methodSignature)
Deprecated.provided for backwards compatibilityPseudo entry()-method.- Overrides:
entryin classAbstractTracer- Parameters:
methodSignature- (ignored)- Returns:
- always null
-
entry
public final TraceMethod entry(String returnType, Object object, String methodSignature)
Pseudo entry()-method.- Overrides:
entryin classAbstractTracer- Parameters:
returnType- (ignored)object- (ignored)methodSignature- (ignored)- Returns:
- always null
-
entry
public final TraceMethod entry(String returnType, Class<?> clazz, String methodSignature)
Pseudo entry()-method.- Overrides:
entryin classAbstractTracer- Parameters:
returnType- (ignored)clazz- (ignored)methodSignature- (ignored)- Returns:
- always null
-
wayout
public final TraceMethod wayout()
Pseudo wayout()-method.- Overrides:
wayoutin classAbstractTracer- Returns:
- always null
-
initCurrentTracingContext
public final void initCurrentTracingContext()
Pseudo initCurrentTracingContext()-method.- Overrides:
initCurrentTracingContextin classAbstractTracer
-
initCurrentTracingContext
public final void initCurrentTracingContext(int debugLevel, boolean online)Pseudo initCurrentTracingContext()-method.- Overrides:
initCurrentTracingContextin classAbstractTracer- Parameters:
debugLevel- (ignored)online- (ignored)
-
logException
public void logException(LogLevel logLevel, Throwable throwable, Class<?> clazz, String methodName)
Pseudo logException()-method. Derived classes should provide code which connects to an alternative logging system.- Overrides:
logExceptionin classAbstractTracer- Parameters:
logLevel- (ignored)throwable- (ignored)clazz- (ignored)methodName- the name of the relevant method
-
logMessage
public void logMessage(LogLevel logLevel, String message, Class<?> clazz, String methodName)
Pseudo logMessage()-method. Derived classes should provide code which connects to an alternative logging system.- Overrides:
logMessagein classAbstractTracer- Parameters:
logLevel- (ignored)message- (ignored)clazz- (ignored)methodName- the originating method
-
-