-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set swsscommon logging level #178
Conversation
src/sonic_ax_impl/__main__.py
Outdated
@@ -75,6 +76,10 @@ def install_fragments(): | |||
sonic_ax_impl.logger.setLevel(log_level) | |||
ax_interface.logger.setLevel(log_level) | |||
swsssdk.logger.setLevel(log_level_sdk) | |||
# Note: swsscommon uses a fixed log level for simplicity | |||
# TODO: improve it when log_level option is used | |||
log_level_swsscommon = swsscommon.Logger.SWSS_ERROR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be modified as below:
if args.get('log_level') is not None and args.get('log_level') == logging.INFO:
log_level_swsscommon = swsscommon.Logger.SWSS_INFO
if args.get('log_level') is not None and args.get('log_level') == logging.ERROR:
log_level_swsscommon = swsscommon.Logger.SWSS_ERROR
else:
log_level_swsscommon = swsscommon.Logger.SWSS_ERROR #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if args.get('log_level') is not None
is not needed and we can directly check the value of args.get('log_level')
Qi, what are we achieving with this change (in order to fix sonic-net/sonic-buildimage#5992). Will the warnings start appearing as errors? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the description of the PR be modified with some context? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warnings in swsscommon will still be warnings. Here I set the log_level higher to ERROR, so warning will disappear in syslog.
In reply to: 529841456 [](ancestors = 529841456)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Depends on sonic-net/sonic-swss-common#418
There are many warning messages in swsscommon. Here I set the log_level higher to ERROR, so warnings will disappear in syslog.
Fixed sonic-net/sonic-buildimage#5992