com.informix.util

## Class Trace

- java.lang.Object
- - com.informix.util.Trace

    public class Trace
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`Trace()`
`Trace(int level, java.lang.String fileName)`
`Trace(int level, java.lang.String fileName, java.lang.String name)`
`Trace(java.lang.String name)`

### Method Summary

Methods
`static java.lang.Object` `getLoggerForClass(java.lang.Class<?> clazz)`
`void` `setNewTraceFile(int level, java.lang.String fileName)` In case a tracing is on, it will close the existing the trace file and open a new trace file.
`void` `writeTrace(int levelNum, java.lang.String stringInfo)`
`void` `writeTrace(java.lang.Object logger, int levelNum, byte[] byteData, char format)`
`void` `writeTrace(java.lang.Object logger, int levelNum, byte[] byteData, char format, int size)`
`void` `writeTrace(java.lang.Object logger, int levelNum, byte[] byteData, int offset, char format, int size)` With Logger Write byte data to the trace file.
`void` `writeTrace(java.lang.Object logger, int levelNum, java.lang.String stringInfo)`
`void` `writeTrace(java.lang.Object logger, int levelNum, java.lang.String stringInfo, boolean data)`
`void` `writeTrace(java.lang.Object logger, int levelNum, java.lang.String stringInfo, int data)`
`void` `writeTrace(java.lang.Object logger, int levelNum, java.lang.String stringInfo, long data)`
`void` `writeTrace(java.lang.Object logger, int levelNum, java.lang.String stringInfo, short data)`
`void` `writeTrace(java.lang.Object logger, int levelNum, java.lang.String stringInfo, java.lang.String data)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Trace

    public Trace()

#### Trace

    public Trace(java.lang.String name)

#### Trace

    public Trace(int level,
         java.lang.String fileName)

#### Trace

    public Trace(int level,
         java.lang.String fileName,
         java.lang.String name)

### Method Detail

#### getLoggerForClass

    public static final java.lang.Object getLoggerForClass(java.lang.Class<?> clazz)

#### setNewTraceFile

    public void setNewTraceFile(int level,
                       java.lang.String fileName)

In case a tracing is on, it will close the existing the trace file and open a new trace file. Note that there are 2 try/catch blocks so that we know where exactly the exception occurred.

#### writeTrace

    public void writeTrace(int levelNum,
                  java.lang.String stringInfo)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  java.lang.String stringInfo)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  java.lang.String stringInfo,
                  java.lang.String data)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  java.lang.String stringInfo,
                  int data)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  java.lang.String stringInfo,
                  short data)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  java.lang.String stringInfo,
                  long data)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  java.lang.String stringInfo,
                  boolean data)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  byte[] byteData,
                  char format)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  byte[] byteData,
                  char format,
                  int size)

#### writeTrace

    public void writeTrace(java.lang.Object logger,
                  int levelNum,
                  byte[] byteData,
                  int offset,
                  char format,
                  int size)

With Logger Write byte data to the trace file. Note that we dump byte data to the trace file either just hex or hex and ascii. If the format is 'h' or 'H' then it's just hex. If the format is 'B' or 'b' then we do both hex and ascii.