Add context.Context to Logger interface
This allows custom logger adapters to add additional fields to log messages. For example, a HTTP server may with to log the request ID. fixes #428
This commit is contained in:
+2
-1
@@ -201,7 +201,8 @@ func BenchmarkSelectWithoutLogging(b *testing.B) {
|
||||
|
||||
type discardLogger struct{}
|
||||
|
||||
func (dl discardLogger) Log(level pgx.LogLevel, msg string, data map[string]interface{}) {}
|
||||
func (dl discardLogger) Log(ctx context.Context, level pgx.LogLevel, msg string, data map[string]interface{}) {
|
||||
}
|
||||
|
||||
func BenchmarkSelectWithLoggingTraceDiscard(b *testing.B) {
|
||||
conn := mustConnect(b, mustParseConfig(b, os.Getenv("PGX_TEST_DATABASE")))
|
||||
|
||||
Reference in New Issue
Block a user