Class Trace
java.lang.Object
org.h2.message.Trace
This class represents a trace module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe trace module id for commands.static final intThe trace module id for constraints.static final intThe trace module id for databases.static final intThe trace module id for file locks.static final intThe trace module id for functions.static final intThe trace module id for indexes.static final intThe trace module id for the JDBC API.static final intThe trace module id for the JDBCX APIprivate final Stringstatic final intThe trace module id for locks.private final Stringstatic final String[]Module names by their ids as array indexes.static final intThe trace module id for schemas.static final intThe trace module id for sequences.static final intThe trace module id for settings.static final intThe trace module id for tables.private intprivate final TraceWriterstatic final intThe trace module id for triggers.static final intThe trace module id for users. -
Constructor Summary
ConstructorsConstructorDescriptionTrace(TraceWriter traceWriter, int moduleId) Trace(TraceWriter traceWriter, String module) -
Method Summary
Modifier and TypeMethodDescriptionvoidWrite a message with trace level DEBUG to the trace system.voidWrite a message with trace level DEBUG to the trace system.voidWrite a message with trace level DEBUG to the trace system.(package private) voidWrite Java source code with trace level DEBUG to the trace system.voidWrite a message with trace level ERROR to the trace system.voidWrite a message with trace level ERROR to the trace system.static StringformatParams(ArrayList<? extends ParameterInterface> parameters) Format the parameter list.voidWrite a message with trace level INFO to the trace system.voidWrite a message with trace level INFO to the trace system.(package private) voidWrite a message with trace level INFO to the trace system.voidWrite Java source code with trace level INFO to the trace system.voidWrite a SQL statement with trace level INFO to the trace system.booleanCheck if the trace level is equal or higher than DEBUG.private booleanisEnabled(int level) booleanCheck if the trace level is equal or higher than INFO.voidsetLevel(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
-
error
-
info
Write a message with trace level INFO to the trace system.- Parameters:
s- the message
-
info
-
info
-
formatParams
Format the parameter list.- Parameters:
parameters- the parameter list- Returns:
- the formatted text
-
infoSQL
-
debug
-
debug
Write a message with trace level DEBUG to the trace system.- Parameters:
s- the message
-
debug
-
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
-