Skip to content

Commit 8defa02

Browse files
committed
more types
1 parent 7d4b3ec commit 8defa02

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tracelog/tracelog.go

Lines changed: 14 additions & 3 deletions
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 {
@@ -112,8 +125,6 @@ func logQueryArgs(args []any) []any {
112125
a = fmt.Sprintf("%s (truncated %d bytes)", v[:l], len(v)-l)
113126
}
114127
}
115-
case pgx.QueryResultFormatsByOID:
116-
continue
117128
}
118129
logArgs = append(logArgs, a)
119130
}

0 commit comments

Comments
 (0)