Tracelog truncation can make output longer.
- Dominant language
- Go
- Stars
- 14.3k
- Forks
- 1.1k
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 11
Description
This is a pretty small nitpick, but I noticed:
https://github.com/jackc/pgx/blob/ea9610f6722e0c6c6073660f14ded3c9683a593e/tracelog/tracelog.go#L101
The message indicating truncation can take up more space than the number of bytes being removed - i.e. if you commonly have values of 65 bytes, it will truncate 1 byte but print out an extra ` (truncated 1 bytes)`, which is 20 more bytes. Maybe changing this can be rolled into a solution for https://github.com/jackc/pgx/issues/998
Contributor guide
Research direction
Start at tracelog/tracelog.go around line 101 and inspect how truncation length and the truncation message are calculated. Review issue #998 for the related direction, then verify that truncating values does not produce output longer than the original value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100