Package org.pjdbc.debug
Class PjdbcDebug
java.lang.Object
org.pjdbc.debug.PjdbcDebug
Utility class for enabling PJDBC debug output.
Provides a simple API for debugging PJDBC driver behavior:
// Enable all debug output
PjdbcDebug.enable();
// Enable with custom stream
PjdbcDebug.enable(System.out);
// Enable only event listener (no JUL logging)
PjdbcDebug.enableEvents();
// Enable only JUL logging (no events)
PjdbcDebug.enableLogging();
// Disable all
PjdbcDebug.disable();
Can also be enabled via system property:
java -Dpjdbc.debug=true ...
- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisable()Disable all debug output.static voidDisable event listener debugging.static voidDisable java.util.logging.static voidenable()Enable all debug output (events + JUL logging) to System.err.static voidenable(PrintStream out) Enable all debug output (events + JUL logging) to custom stream.static voidEnable event listener debugging only.static voidenableEvents(PrintStream out) Enable event listener debugging with custom stream.static voidEnable java.util.logging for org.pjdbc at FINE level.static StringGet a summary of PJDBC configuration for debugging.static booleanCheck if debug mode is currently enabled.
-
Method Details
-
enable
public static void enable()Enable all debug output (events + JUL logging) to System.err. -
enable
Enable all debug output (events + JUL logging) to custom stream.- Parameters:
out- the output stream
-
enableEvents
public static void enableEvents()Enable event listener debugging only. -
enableEvents
Enable event listener debugging with custom stream.- Parameters:
out- the output stream
-
enableLogging
public static void enableLogging()Enable java.util.logging for org.pjdbc at FINE level. -
disable
public static void disable()Disable all debug output. -
disableEvents
public static void disableEvents()Disable event listener debugging. -
disableLogging
public static void disableLogging()Disable java.util.logging. -
isEnabled
public static boolean isEnabled()Check if debug mode is currently enabled.- Returns:
- true if any debug output is enabled
-
getDebugInfo
Get a summary of PJDBC configuration for debugging.- Returns:
- multi-line debug info string
-