Top Description Fields Constructors Methods
org.h2.message

public final Class Trace

extends Object
Class Inheritance
Imports
java.text.MessageFormat, java.util.ArrayList, org.h2.expression.ParameterInterface, org.h2.util.StringUtils

This class represents a trace module.

Field Summary

Modifier and TypeField and Description
public static final int
COMMAND

The trace module id for commands.

public static final int
CONSTRAINT

The trace module id for constraints.

public static final int
DATABASE

The trace module id for databases.

public static final int
FILE_LOCK

The trace module id for file locks.

public static final int
FUNCTION

The trace module id for functions.

public static final int
INDEX

The trace module id for indexes.

public static final int
JDBC

The trace module id for the JDBC API.

public static final int
JDBCX

The trace module id for the JDBCX API

private final String
public static final int
LOCK

The trace module id for locks.

private final String
pack-priv static final String[]
MODULE_NAMES

Module names by their ids as array indexes.

public static final int
SCHEMA

The trace module id for schemas.

public static final int
SEQUENCE

The trace module id for sequences.

public static final int
SETTING

The trace module id for settings.

public static final int
TABLE

The trace module id for tables.

private int
private final TraceWriter
public static final int
TRIGGER

The trace module id for triggers.

public static final int
USER

The trace module id for users.

Constructor Summary

AccessConstructor and Description
pack-priv
Trace(TraceWriter traceWriter, int moduleId)

pack-priv
Trace(TraceWriter traceWriter, String module)

Method Summary

Modifier and TypeMethod and Description
public void
debug(String
the message
s
,
Object...
the parameters
params
)

Write a message with trace level DEBUG to the trace system.

public void
debug(String
the message
s
)

Write a message with trace level DEBUG to the trace system.

public void
debug(Throwable
the exception
t
,
String
the message
s
)

Write a message with trace level DEBUG to the trace system.

pack-priv void
debugCode(String
the source code
java
)

Write Java source code with trace level DEBUG to the trace system.

public void
error(Throwable
the exception
t
,
String
the message
s
)

Write a message with trace level ERROR to the trace system.

public void
error(Throwable
the exception
t
,
String
the message
s
,
Object...
the parameters
params
)

Write a message with trace level ERROR to the trace system.

public static String

Returns:

the formatted text
formatParams
(ArrayList<? extends ParameterInterface>
the parameter list
parameters
)

Format the parameter list.

public void
info(String
the message
s
)

Write a message with trace level INFO to the trace system.

public void
info(String
the message
s
,
Object...
the parameters
params
)

Write a message with trace level INFO to the trace system.

pack-priv void
info(Throwable
the exception
t
,
String
the message
s
)

Write a message with trace level INFO to the trace system.

public void
infoCode(String
the source code
java
)

Write Java source code with trace level INFO to the trace system.

public void
infoSQL(String
the SQL statement
sql
,
String
the parameters used, in the for {1:...}
params
,
long
the update count
count
,
long
the time it took to run the statement in ms
time
)

Write a SQL statement with trace level INFO to the trace system.

public boolean

Returns:

true if it is
isDebugEnabled
()

Check if the trace level is equal or higher than DEBUG.

private boolean
isEnabled(int level)

public boolean

Returns:

true if it is
isInfoEnabled
()

Check if the trace level is equal or higher than INFO.

public void
setLevel(int
the new level
level
)

Set the trace level of this component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COMMANDback to summary
public static final int COMMAND

The trace module id for commands.

CONSTRAINTback to summary
public static final int CONSTRAINT

The trace module id for constraints.

DATABASEback to summary
public static final int DATABASE

The trace module id for databases.

FILE_LOCKback to summary
public static final int FILE_LOCK

The trace module id for file locks.

FUNCTIONback to summary
public static final int FUNCTION

The trace module id for functions.

INDEXback to summary
public static final int INDEX

The trace module id for indexes.

JDBCback to summary
public static final int JDBC

The trace module id for the JDBC API.

JDBCXback to summary
public static final int JDBCX

The trace module id for the JDBCX API

lineSeparatorback to summary
private final String lineSeparator
LOCKback to summary
public static final int LOCK

The trace module id for locks.

moduleback to summary
private final String module
MODULE_NAMESback to summary
pack-priv static final String[] MODULE_NAMES

Module names by their ids as array indexes.

SCHEMAback to summary
public static final int SCHEMA

The trace module id for schemas.

SEQUENCEback to summary
public static final int SEQUENCE

The trace module id for sequences.

SETTINGback to summary
public static final int SETTING

The trace module id for settings.

TABLEback to summary
public static final int TABLE

The trace module id for tables.

traceLevelback to summary
private int traceLevel
traceWriterback to summary
private final TraceWriter traceWriter
TRIGGERback to summary
public static final int TRIGGER

The trace module id for triggers.

USERback to summary
public static final int USER

The trace module id for users.

Constructor Detail

Traceback to summary
pack-priv Trace(TraceWriter traceWriter, int moduleId)
Traceback to summary
pack-priv Trace(TraceWriter traceWriter, String module)

Method Detail

debugback to summary
public void debug(String s, Object... params)

Write a message with trace level DEBUG to the trace system.

Parameters
s:String

the message

params:Object[]

the parameters

debugback to summary
public void debug(String s)

Write a message with trace level DEBUG to the trace system.

Parameters
s:String

the message

debugback to summary
public void debug(Throwable t, String s)

Write a message with trace level DEBUG to the trace system.

Parameters
t:Throwable

the exception

s:String

the message

debugCodeback to summary
pack-priv void debugCode(String java)

Write Java source code with trace level DEBUG to the trace system.

Parameters
java:String

the source code

errorback to summary
public void error(Throwable t, String s)

Write a message with trace level ERROR to the trace system.

Parameters
t:Throwable

the exception

s:String

the message

errorback to summary
public void error(Throwable t, String s, Object... params)

Write a message with trace level ERROR to the trace system.

Parameters
t:Throwable

the exception

s:String

the message

params:Object[]

the parameters

formatParamsback to summary
public static String formatParams(ArrayList<? extends ParameterInterface> parameters)

Format the parameter list.

Parameters
parameters:ArrayList<? extends ParameterInterface>

the parameter list

Returns:String

the formatted text

infoback to summary
public void info(String s)

Write a message with trace level INFO to the trace system.

Parameters
s:String

the message

infoback to summary
public void info(String s, Object... params)

Write a message with trace level INFO to the trace system.

Parameters
s:String

the message

params:Object[]

the parameters

infoback to summary
pack-priv void info(Throwable t, String s)

Write a message with trace level INFO to the trace system.

Parameters
t:Throwable

the exception

s:String

the message

infoCodeback to summary
public void infoCode(String java)

Write Java source code with trace level INFO to the trace system.

Parameters
java:String

the source code

infoSQLback to summary
public void infoSQL(String sql, String params, long count, long time)

Write a SQL statement with trace level INFO to the trace system.

Parameters
sql:String

the SQL statement

params:String

the parameters used, in the for {1:...}

count:long

the update count

time:long

the time it took to run the statement in ms

isDebugEnabledback to summary
public boolean isDebugEnabled()

Check if the trace level is equal or higher than DEBUG.

Returns:boolean

true if it is

isEnabledback to summary
private boolean isEnabled(int level)
isInfoEnabledback to summary
public boolean isInfoEnabled()

Check if the trace level is equal or higher than INFO.

Returns:boolean

true if it is

setLevelback to summary
public void setLevel(int level)

Set the trace level of this component. This setting overrides the parent trace level.

Parameters
level:int

the new level