add ParamsFilter to logger interface

This commit is contained in:
shedyfreak 2023-11-07 13:17:13 +01:00
parent b371257bac
commit 47f9280158

View File

@ -66,6 +66,7 @@ type Interface interface {
Warn(context.Context, string, ...interface{})
Error(context.Context, string, ...interface{})
Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)
ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{})
}
var (
@ -128,13 +129,6 @@ func (l *logger) LogMode(level LogLevel) Interface {
return &newlogger
}
// SetConfig Allow setting configs for your own log implementation
func (l *logger) SetConfig(config Config) Interface {
newlogger := *l
newlogger.Config = config
return &newlogger
}
// Info print info
func (l logger) Info(ctx context.Context, msg string, data ...interface{}) {
if l.LogLevel >= Info {