-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: add argument to remove or preserve root logging handlers #5635
Conversation
hi @JoanFM @girishc13 , plz take a glance at code when free |
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.
This is a good start but the value can only be used by users writing new Executors. It cannot be configured by the current entry points like Flow and Client. If you're up to the task, you can make a few more changes to add the same argument at least to the Flow and the Client parser.
You can refer to the the parsers
package for adding the new argument and you can refer to the following lines where the argument will be used automatically:
Codecov Report
@@ Coverage Diff @@
## master #5635 +/- ##
==========================================
+ Coverage 85.19% 88.29% +3.10%
==========================================
Files 130 131 +1
Lines 10218 10225 +7
==========================================
+ Hits 8705 9028 +323
+ Misses 1513 1197 -316
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Hi @girishc13 . Thanks for your detailed instruction. There are two things which need to clarify:
def mixin_essential_parser(parser, default_name=None):
# leave out original lines, lines below is new
gp.add_argument(
'--suppress_root_logging',
action='store_true',
default=False,
help='If set, then no root handlers will be suppressed from logging.',
)
def set_client_cli_parser(parser=None):
# leave out original lines
mixin_essential_parser(parser) # new
mixin_client_gateway_parser(parser)
mixin_client_features_parser(parser)
mixin_client_protocol_parser(parser)
mixin_prefetch_parser(parser) |
@Jake-00, the def mixin_suppress_root_logging_parser(parser):
parser.add_argument(
'--suppress_root_logging',
action='store_true',
default=False,
help='If set, then no root handlers will be suppressed from logging.',
) This method can now be individually added after the usages of |
Hi @girishc13 , I choose to followe your suggestion and update code with new commit, plz check it out when free, thanks |
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.
One minor change. Otherwise looks good.
I just now append docstring for function |
hi @girishc13, should I add more test to improve test coverage rate? But I do not know why the updated code would affect |
Thanks for this amazing contribution @Jake-00 !!!! Happy to have you as part of the community!! |
Goals:
Updates:
suppress_root_logging
for classJinaLogger
's constructor