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 just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library calls logging.basicConfig to set a RichHandler instance for the root logger if one is not otherwise defined. It then writes its logs to a logger named "rich".
In particular, the issue that is causing problems for my application is that the app does not define any handlers on the root logger, but when we started using ipdata, all of a sudden logs from all of our 3rd party libraries were showing up in our log and in strange formats, resulting in further downstream frustrations.
To be compliant with python best practices, I believe that the logging.basicConfig call should be removed from the ipdata library and the logger name used by the library should be updated to __name__ .
The text was updated successfully, but these errors were encountered:
I just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library calls logging.basicConfig to set a RichHandler instance for the root logger if one is not otherwise defined. It then writes its logs to a logger named "rich".
This violates several of python's best practices regarding configuring logging within a library: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
In particular, the issue that is causing problems for my application is that the app does not define any handlers on the root logger, but when we started using ipdata, all of a sudden logs from all of our 3rd party libraries were showing up in our log and in strange formats, resulting in further downstream frustrations.
To be compliant with python best practices, I believe that the logging.basicConfig call should be removed from the ipdata library and the logger name used by the library should be updated to
__name__
.The text was updated successfully, but these errors were encountered: