Package org.h2.message
Class Trace
java.lang.Object
org.h2.message.Trace
This class represents a trace module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The trace module id for commands.static final int
The trace module id for constraints.static final int
The trace module id for databases.static final int
The trace module id for file locks.static final int
The trace module id for functions.static final int
The trace module id for indexes.static final int
The trace module id for the JDBC API.static final int
The trace module id for the JDBCX APIprivate final String
static final int
The trace module id for locks.private final String
static final String[]
Module names by their ids as array indexes.static final int
The trace module id for schemas.static final int
The trace module id for sequences.static final int
The trace module id for settings.static final int
The trace module id for tables.private int
private final TraceWriter
static final int
The trace module id for triggers.static final int
The trace module id for users. -
Constructor Summary
ConstructorsConstructorDescriptionTrace
(TraceWriter traceWriter, int moduleId) Trace
(TraceWriter traceWriter, String module) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Write a message with trace level DEBUG to the trace system.void
Write a message with trace level DEBUG to the trace system.void
Write a message with trace level DEBUG to the trace system.(package private) void
Write Java source code with trace level DEBUG to the trace system.void
Write a message with trace level ERROR to the trace system.void
Write a message with trace level ERROR to the trace system.static String
formatParams
(ArrayList<? extends ParameterInterface> parameters) Format the parameter list.void
Write a message with trace level INFO to the trace system.void
Write a message with trace level INFO to the trace system.(package private) void
Write a message with trace level INFO to the trace system.void
Write Java source code with trace level INFO to the trace system.void
Write a SQL statement with trace level INFO to the trace system.boolean
Check if the trace level is equal or higher than DEBUG.private boolean
isEnabled
(int level) boolean
Check if the trace level is equal or higher than INFO.void
setLevel
(int level) Set the trace level of this component.
-
Field Details
-
COMMAND
public static final int COMMANDThe trace module id for commands.- See Also:
-
CONSTRAINT
public static final int CONSTRAINTThe trace module id for constraints.- See Also:
-
DATABASE
public static final int DATABASEThe trace module id for databases.- See Also:
-
FUNCTION
public static final int FUNCTIONThe trace module id for functions.- See Also:
-
FILE_LOCK
public static final int FILE_LOCKThe trace module id for file locks.- See Also:
-
INDEX
public static final int INDEXThe trace module id for indexes.- See Also:
-
JDBC
public static final int JDBCThe trace module id for the JDBC API.- See Also:
-
LOCK
public static final int LOCKThe trace module id for locks.- See Also:
-
SCHEMA
public static final int SCHEMAThe trace module id for schemas.- See Also:
-
SEQUENCE
public static final int SEQUENCEThe trace module id for sequences.- See Also:
-
SETTING
public static final int SETTINGThe trace module id for settings.- See Also:
-
TABLE
public static final int TABLEThe trace module id for tables.- See Also:
-
TRIGGER
public static final int TRIGGERThe trace module id for triggers.- See Also:
-
USER
public static final int USERThe trace module id for users.- See Also:
-
JDBCX
public static final int JDBCXThe trace module id for the JDBCX API- See Also:
-
MODULE_NAMES
Module names by their ids as array indexes. -
traceWriter
-
module
-
lineSeparator
-
traceLevel
private int traceLevel
-
-
Constructor Details
-
Trace
Trace(TraceWriter traceWriter, int moduleId) -
Trace
Trace(TraceWriter traceWriter, String module)
-
-
Method Details
-
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
-
isEnabled
private boolean isEnabled(int 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
Write a message with trace level ERROR to the trace system.- Parameters:
t
- the exceptions
- the message
-
error
Write a message with trace level ERROR to the trace system.- Parameters:
t
- the exceptions
- the messageparams
- the parameters
-
info
Write a message with trace level INFO to the trace system.- Parameters:
s
- the message
-
info
Write a message with trace level INFO to the trace system.- Parameters:
s
- the messageparams
- the parameters
-
info
Write a message with trace level INFO to the trace system.- Parameters:
t
- the exceptions
- the message
-
formatParams
Format the parameter list.- Parameters:
parameters
- the parameter list- Returns:
- the formatted text
-
infoSQL
Write a SQL statement with trace level INFO to the trace system.- Parameters:
sql
- the SQL statementparams
- the parameters used, in the for {1:...}count
- the update counttime
- the time it took to run the statement in ms
-
debug
Write a message with trace level DEBUG to the trace system.- Parameters:
s
- the messageparams
- the parameters
-
debug
Write a message with trace level DEBUG to the trace system.- Parameters:
s
- the message
-
debug
Write a message with trace level DEBUG to the trace system.- Parameters:
t
- the exceptions
- the message
-
infoCode
Write Java source code with trace level INFO to the trace system.- Parameters:
java
- the source code
-
debugCode
Write Java source code with trace level DEBUG to the trace system.- Parameters:
java
- the source code
-