-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix([email protected]/[email protected]): dynamic log level control and tail #11039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+196
−19
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update go-log to v2.8.3-0.20251027235339-5fe47a4191be (feat/slog-interop) update go-libp2p to v0.44.1-0.20251027235033-ea2c010ece2d (feat/gologshim-use-slog-default) these changes restore dynamic log level control and tail for go-libp2p subsystems after the migration to slog, fixing the regression introduced in libp2p/go-libp2p#3364 Fixes #11035
- wrap cmd.Process.Kill() to explicitly ignore error - fix const alignment (go fmt)
This was referenced Oct 28, 2025
gammazero
approved these changes
Oct 29, 2025
resolved conflicts in go.sum files by keeping slog integration version
wire gologshim to go-log's slog bridge via init() in cmd/ipfs/kubo/start.go update go-libp2p to v0.44.1-0.20251029234611-789d14c6effe see libp2p/go-libp2p#3419
verify slog.Default() is go-log's bridge via duck typing before passing to gologshim, panics with clear error if go-log's init() didn't run
|
Triage notes:
|
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
This was referenced Nov 5, 2025
update to go-log v2.8.3-0.20251105191458-101e2c1ac85a which provides SlogHandler() function for explicit wiring. simplify start.go by using logging.SlogHandler() directly instead of slog.Default().Handler() with duck-typing verification. more explicit and works even when GOLOG_CAPTURE_DEFAULT_SLOG=false.
update to go-log v2.8.3-0.20251105220843-b453280b0ce2 which changes GOLOG_CAPTURE_DEFAULT_SLOG to opt-in (default=false). kubo now explicitly calls slog.SetDefault(slog.New(logging.SlogHandler())) to integrate slog with go-log's formatting and level control. changes: - cmd/ipfs/kubo/start.go: add slog.SetDefault() call for application-wide slog integration, maintaining existing gologshim.SetDefaultHandler() for go-libp2p subsystem attribution - docs/environment-variables.md: remove GOLOG_LOG_LABELS and GOLOG_CAPTURE_DEFAULT_SLOG sections (no longer relevant to kubo users) - go.mod: update go-log to b453280b0ce2 while automatic slog.Default() capture was convenient, go-libp2p chose to require explicit gologshim registration for clarity. for consistency, we now do the same for slog.Default() - making both integration points explicit rather than mixing automatic and manual approaches. references: - ipfs/go-log#176 (comment) - ipfs/go-log@b453280
|
Switched to final released with the fix: |
Remove references to GOLOG_LOG_LABELS and GOLOG_CAPTURE_DEFAULT_SLOG sections that were deleted in b04533a.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #11035 and restores
ipfs log tailandipfs log levelfunctionality for controlling libp2p log levels.It adds
test/cliregression test to catch any future regression if go-libp2p logs get broken again on go-libp2p update.Context
Details in libp2p/go-libp2p#3418 and ipfs/go-log#176 (especially README).
These changes restore dynamic log level control and tail for go-libp2p subsystems after the migration to slog, fixing the regression introduced in libp2p/go-libp2p#3364
TODO
This PR depends on below PRs to land first: