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
  • Constructor Details

    • 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 Details

    • readConfiguration

      protected void readConfiguration(XPath xpath, Node node)
      Pseudo readConfiguration()-method.
      Overrides:
      readConfiguration in class AbstractTracer
      Parameters:
      xpath - (ignored)
      node - (ignored)
    • open

      public final void open()
      Pseudo open()-method.
      Specified by:
      open in class AbstractTracer
    • close

      public final void close()
      Pseudo close()-method.
      Specified by:
      close in class AbstractTracer
    • out

      protected final NullPrintStream out(int level)
      Returns always a NullPrintStream regardless of the given level.
      Overrides:
      out in class AbstractTracer
      Parameters:
      level - (ignored)
      Returns:
      always a NullPrintStream
    • out

      public final NullPrintStream out()
      Returns always a NullPrintStream.
      Overrides:
      out in class AbstractTracer
      Returns:
      a NullPrintStream
    • entry

      @Deprecated public final TraceMethod entry(String methodSignature)
      Deprecated.
      provided for backwards compatibility
      Pseudo entry()-method.
      Overrides:
      entry in class AbstractTracer
      Parameters:
      methodSignature - (ignored)
      Returns:
      always null
    • entry

      public final TraceMethod entry(String returnType, Object object, String methodSignature)
      Pseudo entry()-method.
      Overrides:
      entry in class AbstractTracer
      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:
      entry in class AbstractTracer
      Parameters:
      returnType - (ignored)
      clazz - (ignored)
      methodSignature - (ignored)
      Returns:
      always null
    • wayout

      public final TraceMethod wayout()
      Pseudo wayout()-method.
      Overrides:
      wayout in class AbstractTracer
      Returns:
      always null
    • initCurrentTracingContext

      public final void initCurrentTracingContext()
      Pseudo initCurrentTracingContext()-method.
      Overrides:
      initCurrentTracingContext in class AbstractTracer
    • initCurrentTracingContext

      public final void initCurrentTracingContext(int debugLevel, boolean online)
      Pseudo initCurrentTracingContext()-method.
      Overrides:
      initCurrentTracingContext in class AbstractTracer
      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:
      logException in class AbstractTracer
      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:
      logMessage in class AbstractTracer
      Parameters:
      logLevel - (ignored)
      message - (ignored)
      clazz - (ignored)
      methodName - the originating method