Fix interactive SQL logging in debug mode#801
Open
RedZapdos123 wants to merge 1 commit into
Open
Conversation
24c79d5 to
18a527a
Compare
Author
|
Now the commit is signed. |
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
e0df6df to
62d10b4
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 PR change?
Issue #418 reported that
mgradm support sql -i --logLevel debugcould corrupt the interactive SQL output because debug logs were written to the same terminal used bypsql.This PR updates the
mgradmroot logger initialization to disable console logging only for interactivesupport sqlsessions when the log level isdebugortrace, preserving file logging and keeping the existing console logging behavior for other commands.It also adds regression tests that cover the logging decision for interactive and non-interactive
support sql.Closes #418.
Codespace
Check if you already have a running container clicking on
Test coverage
Unit tests were added.
The changes were reviewed manually.
Formatting checks were run using
gofmt -w mgradm/cmd/cmd.go mgradm/cmd/cmd_test.go.Focused tests were run using
go test ./mgradm/cmd/....The full build was run using
go build ./....The full test suite was run using
go test ./....Additional verification was run in Docker using
go build ./... && go test ./....The interactive reproduction was verified manually using
mgradm support sql -i --backend kubectl --logLevel debug.DONE
Validation screenshots
Focused tests run locally:
Before the fix
After the fix
Links
Issue(s): #418
Changelogs
No changelog needed because this is a narrow debug-mode interactive terminal fix in
uyuni-tools, not a release-note level user-facing change.Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test(see below)Before you merge
Check How to branch and merge properly!