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)` The constructor with args.

### Method Summary

Methods
`static boolean` `checkSLF4jLoggingService()` The method check if there is a valid binding for SLF4j
`void` `closeTraceFile()`
`static java.lang.Object` `getLoggerForClass(java.lang.Class<?> clazz)`
`java.lang.String` `getTraceFile()`
`int` `getTraceLevel()`
`TraceOS` `getTraceOS()`
`void` `legacyLoggerNote(java.lang.Object loggerFromClass, java.lang.String msg)` If both legacy logging(URL String with Filename) and SLF4J is enabled, the function below will append a note in the legacy logging file.
`void` `resetTrace()`
`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` `setTraceLevel(int level)` Call this method if trace is set and you need to change the trace level.
`void` `setTraceOS(TraceOS traceOS)`
`void` `writeTrace(int levelNum, boolean data)`
`void` `writeTrace(int levelNum, byte[] byteData, char format)` Write byte data to the trace file.
`void` `writeTrace(int levelNum, byte[] byteData, char format, int size)`
`void` `writeTrace(int levelNum, byte[] byteData, int offset, char format, int size)` No longer used after the implementation of SLF4j Write byte data to the trace file.
`void` `writeTrace(int levelNum, double data)`
`void` `writeTrace(int levelNum, float data)`
`void` `writeTrace(int levelNum, int data)`
`void` `writeTrace(int levelNum, long data)`
`void` `writeTrace(int levelNum, short data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo)` These are the methods that we require to write the data to the trace file.
`void` `writeTrace(int levelNum, java.lang.String stringInfo, boolean data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo, double data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo, float data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo, int data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo, long data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo, short data)`
`void` `writeTrace(int levelNum, java.lang.String stringInfo, java.lang.String data)`
`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(int level,
         java.lang.String fileName)

The constructor with args. Note that I am not making any checks for fileName. The assumption is that a file name will always be supplied.

### Method Detail

#### getLoggerForClass

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

#### resetTrace

    public void resetTrace()

#### setTraceLevel

    public void setTraceLevel(int level)

Call this method if trace is set and you need to change the trace level. In case the trace is not set and this method is invoked it will be a no op.

#### 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.

#### getTraceFile

    public java.lang.String getTraceFile()

#### getTraceLevel

    public int getTraceLevel()

#### setTraceOS

    public void setTraceOS(TraceOS traceOS)

#### getTraceOS

    public TraceOS getTraceOS()

#### closeTraceFile

    public void closeTraceFile()

#### writeTrace

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

These are the methods that we require to write the data to the trace file.

#### writeTrace

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

#### writeTrace

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

#### writeTrace

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

#### writeTrace

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

#### writeTrace

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

#### writeTrace

    public void writeTrace(int levelNum,
                  int data)

#### writeTrace

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

#### writeTrace

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

#### writeTrace

    public void writeTrace(int levelNum,
                  short data)

#### writeTrace

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

#### writeTrace

    public void writeTrace(int levelNum,
                  double data)

#### writeTrace

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

#### writeTrace

    public void writeTrace(int levelNum,
                  float data)

#### writeTrace

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

#### writeTrace

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

#### writeTrace

    public void writeTrace(int levelNum,
                  long data)

#### writeTrace

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

#### writeTrace

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

#### writeTrace

    public void writeTrace(int levelNum,
                  boolean data)

#### writeTrace

    public void writeTrace(int levelNum,
                  byte[] byteData,
                  char format)

Write byte data to the trace file. Note that we dump byte data to the trace file as ascii and hex.

#### writeTrace

    public void writeTrace(int levelNum,
                  byte[] byteData,
                  char format,
                  int size)

#### 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(int levelNum,
                  byte[] byteData,
                  int offset,
                  char format,
                  int size)

No longer used after the implementation of SLF4j 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.

#### 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.

#### legacyLoggerNote

    public void legacyLoggerNote(java.lang.Object loggerFromClass,
                        java.lang.String msg)

If both legacy logging(URL String with Filename) and SLF4J is enabled, the function below will append a note in the legacy logging file.

#### checkSLF4jLoggingService

    public static boolean checkSLF4jLoggingService()

The method check if there is a valid binding for SLF4j