Interface ITracer


public interface ITracer
Represents a generic tracer object capable of reporting debugging/tracing information.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String message)
    Logs a message if the ITracer is set to Debug level or higher.
    void
    debug(String format, Object... args)
    Logs a message if the ITracer is set to Debug level or higher.
    void
    Logs an exception if the ITracer is set to Debug level or higher.
    void
    debug(Throwable ex, String message)
    Logs a message with an exception if the ITracer is set to Debug level or higher.
    void
    debugEntry(String message)
    Logs a message if debugging of entry/exit is enabled; use at the entry of methods.
    void
    debugEntry(String format, Object... args)
    Logs a message if debugging of entry/exit is enabled; use at the entry of methods.
    void
    debugExit(String message)
    Logs a message if debugging of entry/exit is enabled; use at the exit of methods.
    void
    debugExit(String format, Object... args)
    Logs a message if debugging of entry/exit is enabled; use at the exit of methods.
    void
    debugSwitched(String switchName, String message)
    Logs a message if the ITracer is set to Debug level or higher and the specified switch is on.
    void
    debugSwitched(String switchName, String format, Object... args)
    Logs a message if the ITracer is set to Debug level or higher and the specified switch is on.
    void
    error(String message)
    Logs a message if the ITracer is set to Error level or higher.
    void
    error(String format, Object... args)
    Logs a message if the ITracer is set to Error level or higher.
    void
    error(String message, Throwable ex)
    Logs a message with an exception if the ITracer is set to Error level or higher.
    void
    Logs an exception if the ITracer is set to Error level or higher.
    void
    fatal(String message)
    Logs a message if the ITracer is set to Fatal level or higher.
    void
    fatal(String format, Object... args)
    Logs a message if the ITracer is set to Fatal level or higher.
    void
    fatal(String message, Throwable ex)
    Logs a message with an exception if the ITracer is set to Fatal level or higher.
    void
    Logs an exception if the ITracer is set to Fatal level or higher.
    void
    info(String message)
    Logs a message if the ITracer is set to Info level or higher.
    void
    info(String format, Object... args)
    Logs a message if the ITracer is set to Info level or higher.
    void
    info(String message, Throwable ex)
    Logs a message with an exception if the ITracer is set to Info level or higher.
    void
    Logs an exception if the ITracer is set to Info level or higher.
    boolean
    Gets a value indicating whether the level of this ITracer is set to Debug or higher.
    boolean
    Gets a value indicating whether debugging of entry/exit is enabled for this ITracer.
    boolean
    Gets a value indicating whether the level of this ITracer is set to Error or higher.
    boolean
    Gets a value indicating whether the level of this ITracer is set to Fatal or higher.
    boolean
    Gets a value indicating whether the level of this ITracer is set to Info or higher.
    boolean
    isSwitchEnabled(String switchName)
    Determines whether a particular tracing switch is enabled for thisTracer.
    boolean
    Gets a value indicating whether the level of this ITracer is set to Warn or higher.
    Pops the last tracing context off the context stack.
    void
    Push a context onto the stack.
    void
    trace(String message)
    Logs a message if the ITracer is set to Trace level or higher.
    void
    trace(String message, Throwable ex)
    Logs a message with an exception if the ITracer is set to Trace level or higher.
    void
    Logs an exception if the ITracer is set to Trace level or higher.
    void
    warn(String message)
    Logs a message if the ITracer is set to Warn level or higher.
    void
    warn(String format, Object... args)
    Logs a message if the ITracer is set to Warn level or higher.
    void
    warn(String message, Throwable ex)
    Logs a message with an exception if the ITracer is set to Warn level or higher.
    void
    Logs an exception if the ITracer is set to Warn level or higher.
  • Method Details

    • debug

      void debug(String message)
      Logs a message if the ITracer is set to Debug level or higher.
      Parameters:
      message - The message to log.
    • debug

      void debug(String format, Object... args)
      Logs a message if the ITracer is set to Debug level or higher. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • debug

      void debug(Throwable ex)
      Logs an exception if the ITracer is set to Debug level or higher.
      Parameters:
      ex - The exception to log.
    • trace

      void trace(String message)
      Logs a message if the ITracer is set to Trace level or higher.
      Parameters:
      message - The message to log.
    • trace

      void trace(Throwable ex)
      Logs an exception if the ITracer is set to Trace level or higher.
      Parameters:
      ex - The exception to log.
    • trace

      void trace(String message, Throwable ex)
      Logs a message with an exception if the ITracer is set to Trace level or higher.
      Parameters:
      ex - The exception to log.
      message - The message to log.
    • debug

      void debug(Throwable ex, String message)
      Logs a message with an exception if the ITracer is set to Debug level or higher.
      Parameters:
      message - The message to log.
      ex - The exception to log.
    • debugEntry

      void debugEntry(String message)
      Logs a message if debugging of entry/exit is enabled; use at the entry of methods.
      Parameters:
      message - The message to log.
    • debugEntry

      void debugEntry(String format, Object... args)
      Logs a message if debugging of entry/exit is enabled; use at the entry of methods. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • debugExit

      void debugExit(String message)
      Logs a message if debugging of entry/exit is enabled; use at the exit of methods.
      Parameters:
      message - The message to log.
    • debugExit

      void debugExit(String format, Object... args)
      Logs a message if debugging of entry/exit is enabled; use at the exit of methods. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • debugSwitched

      void debugSwitched(String switchName, String message)
      Logs a message if the ITracer is set to Debug level or higher and the specified switch is on.
      Parameters:
      switchName - The name of the switch to test.
      message - The message to log.
    • debugSwitched

      void debugSwitched(String switchName, String format, Object... args)
      Logs a message if the ITracer is set to Debug level or higher and the specified switch is on. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      switchName - The name of the switch to test.
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • isSwitchEnabled

      boolean isSwitchEnabled(String switchName)
      Determines whether a particular tracing switch is enabled for thisTracer.
      Parameters:
      switchName - The name of the switch to test.
      Returns:
      true if enabled, false otherwise
    • error

      void error(String message)
      Logs a message if the ITracer is set to Error level or higher.
      Parameters:
      message - The message to log.
    • error

      void error(String format, Object... args)
      Logs a message if the ITracer is set to Error level or higher. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • error

      void error(Throwable ex)
      Logs an exception if the ITracer is set to Error level or higher.
      Parameters:
      ex - The exception to log.
    • error

      void error(String message, Throwable ex)
      Logs a message with an exception if the ITracer is set to Error level or higher.
      Parameters:
      message - The message to log.
      ex - The exception to log.
    • isDebugEnabled

      boolean isDebugEnabled()
      Gets a value indicating whether the level of this ITracer is set to Debug or higher.
      Returns:
      isEnabled
    • isDebugEntryExitEnabled

      boolean isDebugEntryExitEnabled()
      Gets a value indicating whether debugging of entry/exit is enabled for this ITracer.
      Returns:
      isEnabled
    • isErrorEnabled

      boolean isErrorEnabled()
      Gets a value indicating whether the level of this ITracer is set to Error or higher.
      Returns:
      isEnabled
    • isWarnEnabled

      boolean isWarnEnabled()
      Gets a value indicating whether the level of this ITracer is set to Warn or higher.
      Returns:
      isEnabled
    • isFatalEnabled

      boolean isFatalEnabled()
      Gets a value indicating whether the level of this ITracer is set to Fatal or higher.
      Returns:
      isEnabled
    • isInfoEnabled

      boolean isInfoEnabled()
      Gets a value indicating whether the level of this ITracer is set to Info or higher.
      Returns:
      isEnabled
    • popContext

      String popContext()
      Pops the last tracing context off the context stack.

      A Tracing Context is a mechanism to allow the user to output a context message along with the tracing message to aid in parsing interleaved tracing output from different sources. This context message provides a distinctive stamp to the tracing message.

      There are some rules to using contexts: 1. The context implementation must be managed on a per-thread basis 2. Contexts can be nested 3. When entering a context call pushContext(String) 4. When leaving a context call popContext()

      Returns:
      The last context popped off the stack.
    • pushContext

      void pushContext(String context)
      Push a context onto the stack.

      A Tracing Context is a mechanism to allow the user to output a context message along with the tracing message to aid in parsing interleaved tracing output from different sources. This context message provides a distinctive stamp to the tracing message.

      There are some rules to using contexts: 1. The context implementation must be managed on a per-thread basis 2. Contexts can be nested 3. When entering a context call pushContext(String) 4. When leaving a context call popContext()

      Parameters:
      context - the context
    • warn

      void warn(String message)
      Logs a message if the ITracer is set to Warn level or higher.
      Parameters:
      message - The message to log.
    • warn

      void warn(String format, Object... args)
      Logs a message if the ITracer is set to Warn level or higher. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • warn

      void warn(Throwable ex)
      Logs an exception if the ITracer is set to Warn level or higher.
      Parameters:
      ex - The exception to log.
    • warn

      void warn(String message, Throwable ex)
      Logs a message with an exception if the ITracer is set to Warn level or higher.
      Parameters:
      message - The message to log.
      ex - The exception to log.
    • info

      void info(String message)
      Logs a message if the ITracer is set to Info level or higher.
      Parameters:
      message - The message to log.
    • info

      void info(String format, Object... args)
      Logs a message if the ITracer is set to Info level or higher. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • info

      void info(Throwable ex)
      Logs an exception if the ITracer is set to Info level or higher.
      Parameters:
      ex - The exception to log.
    • info

      void info(String message, Throwable ex)
      Logs a message with an exception if the ITracer is set to Info level or higher.
      Parameters:
      message - The message to log.
      ex - The exception to log.
    • fatal

      void fatal(String message)
      Logs a message if the ITracer is set to Fatal level or higher.
      Parameters:
      message - The message to log.
    • fatal

      void fatal(String format, Object... args)
      Logs a message if the ITracer is set to Fatal level or higher. Note the format argument must be applicable to java.text.MessageFormat.format
      Parameters:
      format - A string containing zero or more format items.
      args - An array containing zero or more objects to format.
    • fatal

      void fatal(Throwable ex)
      Logs an exception if the ITracer is set to Fatal level or higher.
      Parameters:
      ex - The exception to log.
    • fatal

      void fatal(String message, Throwable ex)
      Logs a message with an exception if the ITracer is set to Fatal level or higher.
      Parameters:
      message - The message to log.
      ex - The exception to log.