Class StreamTracer

  • All Implemented Interfaces:
    ITracer, ITracer
    Direct Known Subclasses:
    StreamTracer, StreamTracer

    public abstract class StreamTracer
    extends StreamTracer
    implements ITracer
    Implements a simple stream-based execution tracer. Produces normalized sequences of collections in order to facilitate easy comparison.
    Author:
    Holger Eichelberger
    • Field Detail

      • enabled

        private boolean enabled
    • Constructor Detail

      • StreamTracer

        public StreamTracer​(java.io.Writer out,
                            java.lang.String... baseFolder)
        Creates a new stream tracer.
        Parameters:
        out - the output writer
        baseFolder - optional base folders used to make matching (string) values relative
    • Method Detail

      • trace

        public void trace​(java.lang.String text)
        Description copied from interface: ITracer
        Emits a trace string.
        Specified by:
        trace in interface ITracer
        Parameters:
        text - the text to be emitted
      • traceError

        public void traceError​(java.lang.String text)
        Description copied from interface: ITracer
        Emits an error trace string.
        Specified by:
        traceError in interface ITracer
        Parameters:
        text - the text to be emitted
      • traceWarning

        public void traceWarning​(java.lang.String text)
        Description copied from interface: ITracer
        Emits a warning trace string.
        Specified by:
        traceWarning in interface ITracer
        Parameters:
        text - the text to be emitted
      • valueDefined

        public void valueDefined​(VariableDeclaration var,
                                 FieldDescriptor field,
                                 java.lang.Object value)
        Description copied from interface: ITracer
        Is called when a value of a variable is defined.
        Specified by:
        valueDefined in interface ITracer
        Parameters:
        var - the modified variable
        field - the field in var, may be null
        value - the actual value
      • printValueDefined

        protected void printValueDefined​(VariableDeclaration var,
                                         FieldDescriptor field,
                                         java.lang.Object value)
        Is prints a value definition.
        Parameters:
        var - the modified variable
        field - the field in var, may be null
        value - the actual value
      • traceExecutionException

        public void traceExecutionException​(VilException exception)
        Description copied from interface: ITracer
        Traces a top-level execution exception, i.e., execution a VIL script or template failed.
        Specified by:
        traceExecutionException in interface ITracer
        Parameters:
        exception - the exception
      • isEnabled

        protected boolean isEnabled()
        Returns whether this tracer is enabled.
        Returns:
        true for enabled, false else
      • enable

        public void enable​(boolean enable)
        Description copied from interface: ITracer
        Enables or disables the tracer. By default, a tracer is enabled.
        Specified by:
        enable in interface ITracer
        Parameters:
        enable - enable or disable