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
Describe the bug
In python 3 doing logger.warning or logging.error should print to the console/terminal by default. However, in #146 we added a NullHandler to the logger if one was not already created and this is causing the warn/error messages to not be printed. We should update this to only add the NullHandler if the user is not in an interactive environment.
After testing a few things I've noticed that in:
Python 2
Not having a handler configured and using the logger produces No handlers could be found for logger "satpy.my_test" and no log messages.
Python 3
Not having a handler configured and using the logger causes warnings/errors to be printed out. Which IMO is desired.
To Reproduce
Use Satpy and cause any error/warning message to be logged.
Expected behavior
Print error/warning log messages if no handler is configured (default for python 3). No warning about a missing handler when no handler is configured.
Since we still support python 2, my proposed solution is to only add the NullHandler if we are on python 2 and we don't have any handlers configured.
The text was updated successfully, but these errors were encountered:
Describe the bug
In python 3 doing
logger.warning
orlogging.error
should print to the console/terminal by default. However, in #146 we added a NullHandler to the logger if one was not already created and this is causing the warn/error messages to not be printed. We should update this to only add the NullHandler if the user is not in an interactive environment.After testing a few things I've noticed that in:
Python 2
Not having a handler configured and using the logger produces
No handlers could be found for logger "satpy.my_test"
and no log messages.Python 3
Not having a handler configured and using the logger causes warnings/errors to be printed out. Which IMO is desired.
To Reproduce
Use Satpy and cause any error/warning message to be logged.
Expected behavior
Print error/warning log messages if no handler is configured (default for python 3). No warning about a missing handler when no handler is configured.
Since we still support python 2, my proposed solution is to only add the NullHandler if we are on python 2 and we don't have any handlers configured.
The text was updated successfully, but these errors were encountered: