-
Notifications
You must be signed in to change notification settings - Fork 559
Open
Description
Note: This issue was raised to promote discussion of PR #718
There are a few issues with logging in this library:
- The logger is global which can make it difficult to find messages when there are multiple connections
- The global nature of the logger invites data races (and there are some hacks in the tests to avoid this)
- Logging is not intuative (suspect many devs are now used to slog and the approach used here seems archaic)
- Messages would be easier to handle/process if structured logging was used
Given that slog has been part of the standard library since Go 1.21 I think it makes sense to adopt this. I believe it should be possible to make this change in a non-breaking way (and would not move ahead if breaking changes are needed). However I don't consider changes to the logged messages themselves to be breaking (so if anyone is looking for strings within the messages then that may break).
Would really appreciate comments on this change, and the linked PR as I am not currently using this library in production (have moved everything to the V5 client).
stoxx, dhruvjain99 and kenkalang
Metadata
Metadata
Assignees
Labels
No labels