[generic-config-updater] Logging change just before applying it#1934
Merged
ghooo merged 2 commits intosonic-net:masterfrom Nov 18, 2021
Merged
[generic-config-updater] Logging change just before applying it#1934ghooo merged 2 commits intosonic-net:masterfrom
ghooo merged 2 commits intosonic-net:masterfrom
Conversation
qiluo-msft
reviewed
Nov 17, 2021
| if changes_len: | ||
| self.logger.log_notice(f"Applying {changes_len} change{'s' if changes_len != 1 else ''} in order:") | ||
| else: | ||
| self.logger.log_notice(f"No changes to apply.") |
Contributor
There was a problem hiding this comment.
To make it simple, how about
self.logger.log_notice(f"Applying {changes_len} change(s) in order:")
And no need to use if-else.
Contributor
Author
There was a problem hiding this comment.
I prefer log messages to be very informative even if they need a little extra code.
In case of 0, I prefer printing a clear message saying
No changes to apply.
In case of 1 change:
Applying 1 change in order:
In case of many changes:
Applying x changes in order:
I think this makes the logs easier to read.
Contributor
Author
There was a problem hiding this comment.
I can make it
self.logger.log_notice(f"Applying {changes_len} change{'s' if changes_len != 1 else ''} in order{':' if changes_len > 0 else '.'}")
less informative but not by much, but still easy to understand, and consistent with the previous list.
qiluo-msft
approved these changes
Nov 17, 2021
stepanblyschak
pushed a commit
to stepanblyschak/sonic-utilities
that referenced
this pull request
Apr 18, 2022
c31a362 - 2021-11-18 : [202012][Mux orch] set default as standby, change mux orch priority (sonic-net#2015) [Prince Sunny] 9a9e8e6 - 2021-11-18 : [202012] Check VS test failure (sonic-net#2033) [Prince Sunny] 7eaabca - 2021-11-11 : [202012] Fix random failure in PR/CI build. (sonic-net#2016) [Shilong Liu] 85230fe - 2021-11-04 : [orchagent] Fix group name of port-buffer-drop in flexcounterorch.cpp (sonic-net#1967) [Junchao-Mellanox] a55c2ca - 2021-11-03 : [teammgrd]: Handle LAGs cleanup gracefully on Warm/Fast reboot. (sonic-net#1934) [Nazarii Hnydyn]
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 I did
Logging a json change just before applying it. This help knowing at which step we failed change application.
How I did it
Added new log msg
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)