Skip to content

Commit bbc4ff3

Browse files
committed
Don't log technical arguments such as pgx.QueryResultFormatsByOID
1 parent acf06cf commit bbc4ff3

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

tracelog/tracelog.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,20 @@ func LogLevelFromString(s string) (LogLevel, error) {
9494
func logQueryArgs(args []any) []any {
9595
logArgs := make([]any, 0, len(args))
9696

97-
for _, a := range args {
97+
for i, a := range args {
98+
if i == 0 {
99+
switch a.(type) {
100+
case pgx.QueryResultFormats:
101+
continue
102+
case pgx.QueryResultFormatsByOID:
103+
continue
104+
case pgx.QueryExecMode:
105+
continue
106+
case pgx.QueryRewriter:
107+
continue
108+
}
109+
}
110+
98111
switch v := a.(type) {
99112
case []byte:
100113
if len(v) < 64 {

0 commit comments

Comments
 (0)