cic-custodial/pkg/logg/pgx.go
2022-11-30 09:51:24 +00:00

23 lines
395 B
Go

package logg
import (
"context"
"github.com/jackc/pgx/v5/tracelog"
"github.com/zerodha/logf"
)
type PgxLogg struct {
logg *logf.Logger
}
func NewPgxTraceLogg(lo logf.Logger) PgxLogg {
return PgxLogg{
logg: &lo,
}
}
func (l PgxLogg) Log(ctx context.Context, level tracelog.LogLevel, msg string, data map[string]any) {
l.logg.Debug("pgx", "level", level, "msg", msg, "data", data)
}