You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed while using this library that it makes a call to logging.basicConfig. I don't believe libraries should do this. logging.basicConfig should be called only once per runtime. Our software is trying to use python-ws-discovery, and we are finding that it is overriding our logging config.
Ah, sorry, it was already PR and not a discussion.
Taking deeper look. discover and publish are both command line entrypoints and setting up logging here is absolutely relevant.
The issue - the same functions are cmdline entrypoints and actually do the job.
I think basicConfig() shall remain at both those functions, but the code shall be refactored to move actual implementation to public API module. So, your application would not call wsdiscovery.cmdline.discover but wsdiscovery.discover.
wsdiscovery.discover shall be implemented in wsdiscovery.api and imported to both wsdiscovery top level module and to wsdiscovery.cmdline entrypoint. The same for publish API.
@timmarkhuff does it make sence? Could you do this refactoring?
After looking at this more closely, I don't think the problem is with python-ws-discovery at all. The call to logging.basicConfig is in the cmdline.py file which isn't being called by our library. And as you said, it makes sense to have it in that file anyway.
I think the problem is with python-onvif that you use. I submitted a PR there, but there has been no activity on that repo for 5 years, so I'm not sure if anyone will see it.
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
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.
I noticed while using this library that it makes a call to logging.basicConfig. I don't believe libraries should do this. logging.basicConfig should be called only once per runtime. Our software is trying to use python-ws-discovery, and we are finding that it is overriding our logging config.