mirror of https://github.com/jackc/pgx.git
fix data map
parent
9b59dd0346
commit
14050e286d
|
@ -17,11 +17,9 @@ func NewLogger(l log.Logger) *Logger {
|
|||
}
|
||||
|
||||
func (l *Logger) Log(ctx context.Context, level pgx.LogLevel, msg string, data map[string]interface{}) {
|
||||
var logger log.Logger
|
||||
if data != nil {
|
||||
logger = log.With(l.l, data)
|
||||
} else {
|
||||
logger = l.l
|
||||
logger := l.l
|
||||
for k, v := range data {
|
||||
logger = log.With(logger, k, v)
|
||||
}
|
||||
|
||||
switch level {
|
||||
|
|
Loading…
Reference in New Issue