Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions logger/slog.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ func (l *slogLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql
})
}
}

// ParamsFilter filter params
func (l *slogLogger) ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{}) {
if l.Parameterized {
return sql, nil
}
return sql, params
}
Comment on lines +92 to +98
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[BestPractice]

[CodeDuplication] The ParamsFilter method is nearly identical to the existing implementation in logger/logger.go. The only difference is the field name (l.Parameterized vs l.Config.ParameterizedQueries). Consider extracting this logic to a shared utility function or ensuring consistent field naming across logger implementations to avoid code duplication.

Loading