org.h2.message
Class Trace

java.lang.Object
  extended by org.h2.message.Trace

public class Trace
extends java.lang.Object

This class represents a trace module.


Field Summary
static java.lang.String COMMAND
          The trace module name for commands.
static java.lang.String CONSTRAINT
          The trace module name for constraints.
static java.lang.String DATABASE
          The trace module name for databases.
static java.lang.String FILE_LOCK
          The trace module name for file locks.
static java.lang.String FUNCTION
          The trace module name for functions.
static java.lang.String INDEX
          The trace module name for indexes.
static java.lang.String JDBC
          The trace module name for the JDBC API.
static java.lang.String LOCK
          The trace module name for locks.
static java.lang.String LOG
          The trace module name for the transaction log.
static java.lang.String PAGE_STORE
          The trace module name for the page store.
static java.lang.String SCHEMA
          The trace module name for schemas.
static java.lang.String SEQUENCE
          The trace module name for sequences.
static java.lang.String SESSION
          The trace module name for sessions.
static java.lang.String SETTING
          The trace module name for settings.
static java.lang.String TABLE
          The trace module name for tables.
static java.lang.String TRIGGER
          The trace module name for triggers.
static java.lang.String USER
          The trace module name for users.
 
Method Summary
 void debug(java.lang.String s)
          Write a message with trace level DEBUG to the trace system.
 void debug(java.lang.String s, java.lang.Throwable t)
          Write a message with trace level DEBUG to the trace system.
 void error(java.lang.String s, java.lang.Throwable t)
          Write a message with trace level ERROR to the trace system.
 void info(java.lang.String s)
          Write a message with trace level INFO to the trace system.
 void infoCode(java.lang.String java)
          Write Java source code with trace level INFO to the trace system.
 void infoSQL(java.lang.String sql, java.lang.String params, int count, long time)
          Write a SQL statement with trace level INFO to the trace system.
 boolean isDebugEnabled()
          Check if the trace level is equal or higher than DEBUG.
 boolean isInfoEnabled()
          Check if the trace level is equal or higher than INFO.
 void setLevel(int level)
          Set the trace level of this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND

public static final java.lang.String COMMAND
The trace module name for commands.

See Also:
Constant Field Values

CONSTRAINT

public static final java.lang.String CONSTRAINT
The trace module name for constraints.

See Also:
Constant Field Values

DATABASE

public static final java.lang.String DATABASE
The trace module name for databases.

See Also:
Constant Field Values

FUNCTION

public static final java.lang.String FUNCTION
The trace module name for functions.

See Also:
Constant Field Values

FILE_LOCK

public static final java.lang.String FILE_LOCK
The trace module name for file locks.

See Also:
Constant Field Values

INDEX

public static final java.lang.String INDEX
The trace module name for indexes.

See Also:
Constant Field Values

JDBC

public static final java.lang.String JDBC
The trace module name for the JDBC API.

See Also:
Constant Field Values

LOCK

public static final java.lang.String LOCK
The trace module name for locks.

See Also:
Constant Field Values

LOG

public static final java.lang.String LOG
The trace module name for the transaction log.

See Also:
Constant Field Values

SCHEMA

public static final java.lang.String SCHEMA
The trace module name for schemas.

See Also:
Constant Field Values

SESSION

public static final java.lang.String SESSION
The trace module name for sessions.

See Also:
Constant Field Values

SEQUENCE

public static final java.lang.String SEQUENCE
The trace module name for sequences.

See Also:
Constant Field Values

SETTING

public static final java.lang.String SETTING
The trace module name for settings.

See Also:
Constant Field Values

TABLE

public static final java.lang.String TABLE
The trace module name for tables.

See Also:
Constant Field Values

TRIGGER

public static final java.lang.String TRIGGER
The trace module name for triggers.

See Also:
Constant Field Values

USER

public static final java.lang.String USER
The trace module name for users.

See Also:
Constant Field Values

PAGE_STORE

public static final java.lang.String PAGE_STORE
The trace module name for the page store.

See Also:
Constant Field Values
Method Detail

setLevel

public void setLevel(int level)
Set the trace level of this component. This setting overrides the parent trace level.

Parameters:
level - the new level

isInfoEnabled

public boolean isInfoEnabled()
Check if the trace level is equal or higher than INFO.

Returns:
true if it is

isDebugEnabled

public boolean isDebugEnabled()
Check if the trace level is equal or higher than DEBUG.

Returns:
true if it is

error

public void error(java.lang.String s,
                  java.lang.Throwable t)
Write a message with trace level ERROR to the trace system.

Parameters:
s - the message
t - the exception

info

public void info(java.lang.String s)
Write a message with trace level INFO to the trace system.

Parameters:
s - the message

infoSQL

public void infoSQL(java.lang.String sql,
                    java.lang.String params,
                    int count,
                    long time)
Write a SQL statement with trace level INFO to the trace system.

Parameters:
sql - the SQL statement
params - the parameters used, in the for {1:...}
count - the update count
time - the time it took to run the statement in ms

debug

public void debug(java.lang.String s)
Write a message with trace level DEBUG to the trace system.

Parameters:
s - the message

debug

public void debug(java.lang.String s,
                  java.lang.Throwable t)
Write a message with trace level DEBUG to the trace system.

Parameters:
s - the message
t - the exception

infoCode

public void infoCode(java.lang.String java)
Write Java source code with trace level INFO to the trace system.

Parameters:
java - the source code