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
Problems with the `warnings` module:
* Undesirable output in tests, although it could be filtered out.
* Output unsuited for users: shows source code of Python-dotenv. Users
don't know what to do with that.
* Rather meant for programming issues (e.g. deprecation) rather than
runtime issues (file not found).
Problems with the `logging` module:
* Slightly less easy to test, unlike warnings with
`catch_warnings(record=True)`, because you need to use the `mock`
package for compatibility with Python 2.
Despite this last issue, I think it makes more sense to use the
`logging` module as a base for warnings.
Of course, `logging` is not suited to all forms of output, so this
change doesn't mean `logging` has to be used everywhere. For instance,
if we want to improve the output of the `dotenv` CLI later, we might
want to use `print`, `click.echo` or other printing facilities.
0 commit comments