summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v4/logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v4/logger.go')
-rw-r--r--vendor/github.com/jackc/pgx/v4/logger.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/jackc/pgx/v4/logger.go b/vendor/github.com/jackc/pgx/v4/logger.go
index 89fd5af51..41f8b7e87 100644
--- a/vendor/github.com/jackc/pgx/v4/logger.go
+++ b/vendor/github.com/jackc/pgx/v4/logger.go
@@ -47,9 +47,18 @@ type Logger interface {
Log(ctx context.Context, level LogLevel, msg string, data map[string]interface{})
}
+// LoggerFunc is a wrapper around a function to satisfy the pgx.Logger interface
+type LoggerFunc func(ctx context.Context, level LogLevel, msg string, data map[string]interface{})
+
+// Log delegates the logging request to the wrapped function
+func (f LoggerFunc) Log(ctx context.Context, level LogLevel, msg string, data map[string]interface{}) {
+ f(ctx, level, msg, data)
+}
+
// LogLevelFromString converts log level string to constant
//
// Valid levels:
+//
// trace
// debug
// info