Conversation
A small release that adjust some noisy logging levels and adds a method for dynamically change the slog Handler for better integration with applications that use go-log. ◆ lidel@lidel.org 3f09fa4 feat(gologshim): Add SetDefaultHandler (#3418) ◆ vsnqmzpw lidel@lidel.org 7b78dd6 fix(websocket): use debug level for http.Server errors
update to go-libp2p v0.45.0 pre-release (3b3b1fd6) and latest go-log (eea1e41) add documentation for GOLOG_LOG_LABELS and GOLOG_CAPTURE_DEFAULT_SLOG environment variables see libp2p/go-libp2p#3424
There was a problem hiding this comment.
Yes, good to go 👍
Tested this PR (3b3b1fd) extensively in:
Level control and go-log interop work as expected.
Confirmed ipfs log level and ipfs log tail RPC work in, including extra details being correctly passed from slog→go-log→kubo→rpc→webui:
I released go-log v2.9.0 with golog.SlogHandler() and updated godoc example in go-libp2p (efa486d)
@MarcoPolo feel free to ship 🙏
If possible, Release notes for go-libp2p 0.45 should document the code that go-log+go-libp2p users need to set if they want to restore logs that were broken in go-libp2p 0.44:
- update to go-log v2.9.0
- update to go-libp2p >= 0.45
- manually wire go-log and go-libp2p together:
import ( "log/slog" golog "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p/gologshim" ) func init() { // Connect go-libp2p to go-log gologshim.SetDefaultHandler(golog.SlogHandler()) // Optional: route all slog logs through go-log slog.SetDefault(slog.New(golog.SlogHandler())) }
update integration example to use golog.SlogHandler() instead of slog.Default().Handler(). more explicit and works even when GOLOG_CAPTURE_DEFAULT_SLOG=false.
|
Suggested version: Changes in configuration file(s): (empty)
Cutting a Release (and modifying non-markdown files)This PR is modifying both Automatically created GitHub ReleaseA draft GitHub Release has been created. |
A small release that adjust some noisy logging levels and adds a method for dynamically change the slog Handler for better integration with applications that use go-log.
@lidel can you confirm this works as expected for IPFS?