2
0

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:
Jack Christensen
2019-08-03 16:16:21 -05:00
parent ab1edc79e0
commit 3028821487
11 changed files with 68 additions and 22 deletions
+2 -1
View File
@@ -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")))