#49853 Issue 49844 - lib389: don't set up logging at module scope
Closed by spichugi. Opened by spichugi.
spichugi/389-ds-base logging_fix  into  master

Download 49853.patch

Bug description: lib389 was calling logging.basicConfig()
at several places at module scope level. This was causing
imports from these modules to add an unwanted handler
to the root logger of the python's standard logging module.

Fix description: Set up logging only in the scripts that are
using lib389.
ALso, remove unused imports in init.py

https://pagure.io/389-ds-base/issue/49844

Reviewed by: spichugi

rebased onto 1dcffa633a1409e94c6b8af891c2911c173f8bd0

rebased onto 7892486ba5c9ffcd0f51167df995af84f9b2c3d9

Pull-Request has been merged by spichugi

There was some odd behaviours with logging in python, because it heavily depends on order of module loading. That's why that was put around the place. So it's worth being sure to check that all the cli outputs still work as expected after this change :)

I think it looks okay because of the nature of the change, but keep in mind if you see odd logging behaviour,

Thanks!

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/2912

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata