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 think it would be good practice to remove that call entirely so that the user of the module can decide how he want's to setup his logger. If you insist on setting the logLevel I would suggest using logger.setLevel which only modifies your own logger.
An alternative would be calling basicConfig in your class initialization, in case the user hasn't done it so far. This ensures that a logger is properly setup but doesn't overwrite anything if the user has already done his own logging setup (which usually happens after importing modules but before initializing any classes).
But as I said, I would leave the choices of logging setup to the user. Everyone has different loggging needs ;)
The text was updated successfully, but these errors were encountered:
Thanks a lot!
You are right. I removed the call to basicConfig(), since loglevel is anyway setup during the creation of the objects.
A new version 0.5.1 is on pypi.
Hi there,
thank you for your awesome work here! I just have one tiny problem with your module:
Importing your module breaks the logging setup of the importing module because you're calling basicConfig (which cannot be used twice) on import here
python-fhem/fhem/fhem/__init__.py
Line 36 in f466959
I think it would be good practice to remove that call entirely so that the user of the module can decide how he want's to setup his logger. If you insist on setting the logLevel I would suggest using
logger.setLevel
which only modifies your own logger.An alternative would be calling basicConfig in your class initialization, in case the user hasn't done it so far. This ensures that a logger is properly setup but doesn't overwrite anything if the user has already done his own logging setup (which usually happens after importing modules but before initializing any classes).
But as I said, I would leave the choices of logging setup to the user. Everyone has different loggging needs ;)
The text was updated successfully, but these errors were encountered: