DataBridge Documentation 2.0.17
A Java library for managing database connections and transactions
|
Classes | |
enum | LogLevel |
enum | LogType |
enum | SQLOperation |
Public Member Functions | |
void | log (LogLevel lvl, String fmt, Object... args) |
void | log (LogLevel lvl, String msg) |
void | log (LogLevel lvl, String msg, Exception ex) |
void | log (LogLevel lvl, String msg, SQLOperation op, Object obj) |
void | logResultSet (ResultSet resultSet) |
Static Public Member Functions | |
static String | getCurrentTimestamp () |
static SQLogger | getLogger () |
static SQLogger | getLogger (LogLevel logLevel) |
static SQLogger | getLogger (LogLevel logLevel, LogType logType) |
static void | printSelf () |
SQLogger is a logging utility class designed for logging SQL operations, including INSERT, UPDATE, DELETE, SELECT, and others. It supports various log levels (e.g., NONE, ERRO, WARN, INFO, ALL) and log types (e.g., FILE, STDERR, ALL). It can log to standard error, log files, or both. It also includes a method for formatting and printing SQL query result sets in a tabular format.
|
static |
|
static |
Prints the current configuration of the SQLogger.
|
static |
Returns the current timestamp formatted as "yyyy-MM-dd HH:mm:ss".
void io.github.kdesp73.databridge.helpers.SQLogger.log | ( | LogLevel | lvl, |
String | fmt, | ||
Object... | args ) |
Logs a message with the specified log level and formatted arguments.
lvl | the log level. |
fmt | the format string. |
args | the arguments for the format string. |
void io.github.kdesp73.databridge.helpers.SQLogger.log | ( | LogLevel | lvl, |
String | msg ) |
Logs a message with the specified log level.
lvl | the log level. |
msg | the message to log. |
void io.github.kdesp73.databridge.helpers.SQLogger.log | ( | LogLevel | lvl, |
String | msg, | ||
Exception | ex ) |
Logs a message and an exception with the specified log level.
lvl | the log level. |
msg | the message to log. |
ex | the exception to log. |
void io.github.kdesp73.databridge.helpers.SQLogger.log | ( | LogLevel | lvl, |
String | msg, | ||
SQLOperation | op, | ||
Object | obj ) |
Logs a SQL operation with the specified log level and operation details.
lvl | the log level. |
msg | the message to log. |
op | the SQL operation being logged. |
obj | the object related to the operation. |
void io.github.kdesp73.databridge.helpers.SQLogger.logResultSet | ( | ResultSet | resultSet | ) |
Logs the result set of a SQL query, printing the results in a formatted table.
resultSet | the result set to log. |