Migrate logging from internal/logger to log/slog for amd-ctk#112
Open
shiv-tyagi wants to merge 2 commits intoROCm:mainfrom
Open
Migrate logging from internal/logger to log/slog for amd-ctk#112shiv-tyagi wants to merge 2 commits intoROCm:mainfrom
shiv-tyagi wants to merge 2 commits intoROCm:mainfrom
Conversation
Replace the custom logger.Log (backed by standard log.Logger) with Go's structured logging (log/slog) across the project. - Configure slog in cmd/amd-ctk with --debug flag for level control (defaults to Info on stderr) - Configure slog in cmd/container-runtime via internal/logger.Init for file-based logging at Debug level to preserve the previous behavior where all log lines were captured - Update internal/logger to set slog as the default logger instead of exposing a log.Logger instance - Convert all logger.Log.Printf calls to appropriate slog levels (Info, Debug, Warn, Error) with structured key-value pairs - Remove logger.Log references from all internal packages and tests
The container runtime no longer leaks GPU allocation, release, and exclusive-enforcement messages into Docker's error output. These messages now go exclusively to the runtime log file. Update the gpu-tracker doc's exclusive access example to show the new Docker error output and direct users to the runtime log instead. Also fix the stale GPU info mismatch error message wording and document the new --debug/-d flag for amd-ctk across gpu-tracker, troubleshooting, and CDI docs.
Member
Author
Test ChecklistGPU Tracker — Enable/Disable/Reset
GPU Tracker — Status
GPU Tracker — Exclusive/Shared
GPU Tracker — Release
GPU Tracker — Error Scenarios
GPU Tracker — JSON Backward Compatibility
Container Runtime — GPU Allocation
Container Runtime — Exclusive GPU Enforcement
Container Runtime — Log File
CDI — Generate/Validate
CLI — Debug Flag
Signal Handling
Unit Tests
I have performed these tests on a GPU machine and carefully verified all outputs. |
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
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.
Replace the custom logger.Log (backed by standard log.Logger) with Go's structured logging (log/slog) across the project.