Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.novell.nds.dirxml.driver
Class Trace

    java.lang.Object
      com.novell.nds.dirxml.driver.Trace

    public class Trace

extends Object

Facility for drivers to use to output debugging trace messages to the DSTrace console and to the DirXML log file.

This class provides a facility for tracing localized messages as well as hard-coded strings. Use the `trace()` methods that take a `MessageSource` parameter for localizable trace messages.

There is a 2K limit on message size for the DSTrace console. Messages longer than 2K will not appear on the DSTrace console, but will be truncated and logged to the DirXML log file.

See Also:
  `MessageSource`, `LocalizedMessageSource`

Field Summary
`static int` | `DEFAULT_TRACE` Constant corresponding to trace level at or above which trace messages are displayed.
`static int` | `NO_TRACE` Constant corresponding to no trace messages level
`static int` | `XML_TRACE` Constant corresponding to trace level at or above which XML documents are displayed

Constructor Summary
`Trace(String identifier)` Create an instance of a `Trace` object for use with a driver.

Method Summary
`int` | `getTraceLevel()` Get the current trace level.
`void` | `popIndent()` Restore indent state after a `pushIndent()` call.
`void` | `pushIndent(int tabCount)` Indent messages `tabCount` tabs.
`static void` | `registerImpl(Class implementation, double priority)`
`void` | `resetIndent()` Reset the indent level to 0 regardless of any pushed levels
`void` | `trace(Document document)` Display an XML document if current trace level is `XML_TRACE` or greater
`void` | `trace(Document document, int level)` Display an XML document if current trace level is greater than or equal to the passed level.
`void` | `trace(String message)` Display a trace message if current trace level is greater than or equal to the `DEFAULT_TRACE` level.
`void` | `trace(String message, int level)` Display a trace message if current trace level is greater than passed level
`void` | `trace(String messageID, MessageSource messageSource)` Retrieve and output a message from a MessageSource if current trace level is >= `DEFAULT_TRACE`.
`void` | `trace(String msgID, MessageSource messageSource, int level)` Retrieve and output a message from a MessageSource if the current trace level is >= the passed trace level.
`void` | `trace(String messageID, MessageSource messageSource, Object parm1)` Retrieve, format, and display a 1-parameter message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.
`void` | `trace(String messageID, MessageSource messageSource, Object[] parms)` Retrieve, format, and display a parameterized message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.
`void` | `trace(String messageID, MessageSource messageSource, Object[] parms, int level)` Retrieve, format, and display a parameterized message from a `MessageSource` if current trace level is >= the passed trace level.
`void` | `trace(String messageID, MessageSource messageSource, Object parm1, int level)` Retrieve, format, and display a 1-parameter message from a `MessageSource` if current trace level is >= the passed trace level.
`void` | `trace(String messageID, MessageSource messageSource, Object parm1, Object parm2)` Retrieve, format, and display a 2-parameter message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.
`void` | `trace(String messageID, MessageSource messageSource, Object parm1, Object parm2, int level)` Retrieve, format, and display a 2-parameter message from a `MessageSource` if current trace level is >= the passed trace level.
`void` | `trace(String messageID, MessageSource messageSource, Object parm1, Object parm2, Object parm3)` Retrieve, format, and display a 3-parameter message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.
`void` | `trace(String messageID, MessageSource messageSource, Object parm1, Object parm2, Object parm3, int level)` Retrieve, format, and display a 3-parameter message from a `MessageSource` if current trace level is >= the passed trace level.
`void` | `trace(XmlDocument document)` Display an XML document if current trace level is `XML_TRACE` or greater
`void` | `trace(XmlDocument document, int level)` Display an XML document if current trace level is greater than or equal to the passed level.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NO_TRACE

    public static final int NO_TRACE

  Constant corresponding to no trace messages level

  See Also:
    Constant Field Values

### DEFAULT_TRACE

    public static final int DEFAULT_TRACE

  Constant corresponding to trace level at or above which trace messages are displayed.

  See Also:
    Constant Field Values

### XML_TRACE

    public static final int XML_TRACE

  Constant corresponding to trace level at or above which XML documents are displayed

  See Also:
    Constant Field Values

Constructor Detail

### Trace

    public Trace(String identifier)

  Create an instance of a `Trace` object for use with a driver.

  Parameters:
    `identifier` - A String that is prepended to trace messages for identification purposes

Method Detail

### registerImpl

    public static void registerImpl(Class implementation,
                                    double priority)

### getTraceLevel

    public int getTraceLevel()

  Get the current trace level. This is useful for checking the level before doing extra computation that won't get displayed if the trace level is too low (for example, building up a string from multiple parts).

  Returns:
    The current trace level

### pushIndent

    public void pushIndent(int tabCount)

  Indent messages `tabCount` tabs. This will indent messages after the `identifier` string is output.

  Parameters:
    `tabCount` - Number of tabs to indent message.
  See Also:
    `popIndent()`

### popIndent

    public void popIndent()

  Restore indent state after a `pushIndent()` call.

  See Also:
    `pushIndent(int)`

### resetIndent

    public void resetIndent()

  Reset the indent level to 0 regardless of any pushed levels

### trace

    public void trace(String message)

  Display a trace message if current trace level is greater than or equal to the `DEFAULT_TRACE` level.

  Parameters:
    `message` - The message to display

### trace

    public void trace(String messageID,
                      MessageSource messageSource)

  Retrieve and output a message from a MessageSource if current trace level is >= `DEFAULT_TRACE`.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - MessageSource from which to obtain message

### trace

    public void trace(String msgID,
                      MessageSource messageSource,
                      int level)

  Retrieve and output a message from a MessageSource if the current trace level is >= the passed trace level.

  Parameters:
    `msgID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message
    `level` - trace level for message

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object parm1)

  Retrieve, format, and display a 1-parameter message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parm1` - parameter for message.

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object parm1,
                      int level)

  Retrieve, format, and display a 1-parameter message from a `MessageSource` if current trace level is >= the passed trace level.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parm1` - parameter for message.
    `level` - trace level for message

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object parm1,
                      Object parm2)

  Retrieve, format, and display a 2-parameter message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parm1` - parameter {0} for message.
    `parm2` - parameter {1} for message.

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object parm1,
                      Object parm2,
                      int level)

  Retrieve, format, and display a 2-parameter message from a `MessageSource` if current trace level is >= the passed trace level.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parm1` - parameter {0} for message.
    `parm2` - parameter {1} for message.
    `level` - trace level for message

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object parm1,
                      Object parm2,
                      Object parm3)

  Retrieve, format, and display a 3-parameter message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parm1` - parameter {0} for message.
    `parm2` - parameter {1} for message.
    `parm3` - parameter {2} for message.

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object parm1,
                      Object parm2,
                      Object parm3,
                      int level)

  Retrieve, format, and display a 3-parameter message from a `MessageSource` if current trace level is >= the passed trace level.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parm1` - parameter {0} for message.
    `parm2` - parameter {1} for message.
    `parm3` - parameter {2} for message.
    `level` - trace level for message

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object[] parms)

  Retrieve, format, and display a parameterized message from a `MessageSource` if the current trace level is >= `DEFAULT_TRACE`.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parms` - array of parameters for message.

### trace

    public void trace(String messageID,
                      MessageSource messageSource,
                      Object[] parms,
                      int level)

  Retrieve, format, and display a parameterized message from a `MessageSource` if current trace level is >= the passed trace level.

  Parameters:
    `messageID` - identifier of message in source.
    `messageSource` - `MessageSource` from which to obtain message string.
    `parms` - array of parameters for message.
    `level` - trace level for message

### trace

    public void trace(String message,
                      int level)

  Display a trace message if current trace level is greater than passed level

  Parameters:
    `message` - The message to display
    `level` - The trace level for this message

### trace

    public void trace(Document document)

  Display an XML document if current trace level is `XML_TRACE` or greater

  Parameters:
    `document` - The XML document to display

### trace

    public void trace(Document document,
                      int level)

  Display an XML document if current trace level is greater than or equal to the passed level.

  Parameters:
    `document` - The XML document to display
    `level` - The trace level at or above which to display

### trace

    public void trace(XmlDocument document)

  Display an XML document if current trace level is `XML_TRACE` or greater

  Parameters:
    `document` - The XML document to display

### trace

    public void trace(XmlDocument document,
                      int level)

  Display an XML document if current trace level is greater than or equal to the passed level.

  Parameters:
    `document` - The XML document to display
    `level` - The trace level for this message

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD