Closed
Conversation
cd965cc to
7b69735
Compare
Introduce ErrorTracer and ErrorLogger interfaces to prevent duplicate error logs in console output. The RecordError methods only record to spans while Error methods both log to console and record to spans. Changes: - Add ErrorTracer interface with RecordError methods - Add ErrorLogger interface with Error methods - Implement RecordError to only write to spans - Refactor Error to delegate to RecordError - Add helper functions GetTracer and GetLogger - Add comprehensive test coverage for new behavior This resolves duplicate error logging when errors are propagated up the call stack, as intermediate functions can use RecordError while top-level handlers use Error. Signed-off-by: Kim Christensen <[email protected]>
commands Update all installation command handlers to explicitly log errors at the top level using log.Error(). This ensures errors are logged to console exactly once at the command handler level, preventing duplicate error messages. Changes: - Add tracing package import - Update 9 command handlers (list, show, apply, delete, runs list, install, upgrade, invoke, uninstall) - Add explicit error logging in RunE functions - Keep PreRunE unchanged for validation only This is part of Phase 3 (Command Handler Updates) of the centralized error logging implementation plan. Signed-off-by: Kim Christensen <[email protected]> fixup Signed-off-by: Kim Christensen <[email protected]>
7b69735 to
cc8c7cd
Compare
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.
What does this change
Give a summary of the change, and how it affects end-users. It's okay to copy/paste your commit messages.
For example if it introduces a new command or modifies a commands output, give an example of you running the command and showing real output here.
What issue does it fix
Closes # (issue)
If there is not an existing issue, please make sure we have context on why this change is needed. See our Contributing Guide for examples of when an existing issue isn't necessary.
Notes for the reviewer
Put any questions or notes for the reviewer here.
Checklist