forked from sonic-net/sonic-mgmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace logging.xxx with logger.xxx in common libs (sonic-net#7450)
What is the motivation for this PR? The devutils script supports output results to a json. To ensure that json output is not polluted by error messages, we need to redirect error messages to /dev/null. The devutils script called library code in snmp_pdu_controller.py in multiple threads. The library uses logging.error() to log error messages. Somehow, the error messages are output to stdout instead of stderr. If we run the devutils script with bash option 2>/dev/null to hide error messages, it does not work. The error messages are still output to stdout. After changed logging.error() to logger.error(), then redirecting stderr to /dev/null works. This change also updated some other libraries to use logger.xxx instead of logging.xxx. How did you do it? This change updated some common libraries to use logger.xxx instead of logging.xxx. Signed-off-by: Xin Wang <[email protected]>
- Loading branch information
Showing
6 changed files
with
52 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.