*This issue should not be confused with what the change in #1807 is trying to improve. The outcome of that PR is unrelated to this issue, because GitPython itself uses `logging.NullHandler` not `git.util.NullHandler`.* Although the [recommended default](https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library) behavior for libraries is to allow messages of `WARNING` or higher severity to be displayed when the calling code does not configure logging, a library also has the option of causing its messages to be suppressed by default by registering an instance of `NullHandler` as a handler. (Logging is still happening; messages can still be subscribed to by the addition of other handlers.) GitPython takes this approach, though in a bit of a different way the Python documentation suggests for it. In GitPython, `NullHandler`s are registered for the individual modules' loggers rather than for a library-wide "top-level" logger. This is with one exception. `git.repo.base` does not register a `NullHandler`: ```text (.venv) ek@Glub:~/repos-wsl/GitPython (main $=)$ git grep -Fn NullHandler -- git/ git/cmd.py:85:log.addHandler(logging.NullHandler()) git/config.py:65:log.addHandler(logging.NullHandler()) git/objects/commit.py:56:log.addHandler(logging.NullHandler()) git/objects/submodule/base.py:60:log.addHandler(logging.NullHandler()) git/objects/submodule/root.py:26:log.addHandler(logging.NullHandler()) git/remote.py:69:log.addHandler(logging.NullHandler()) git/util.py:1297:class NullHandler(logging.Handler): (.venv) ek@Glub:~/repos-wsl/GitPython (main $=)$ git grep -Fn logging.getLogger -- git/ git/cmd.py:84:log = logging.getLogger(__name__) git/config.py:64:log = logging.getLogger("git.config") git/objects/commit.py:55:log = logging.getLogger("git.objects.commit") git/objects/submodule/base.py:59:log = logging.getLogger("git.objects.submodule.base") git/objects/submodule/root.py:25:log = logging.getLogger("git.objects.submodule.root") git/remote.py:68:log = logging.getLogger("git.remote") git/repo/base.py:92:log = logging.getLogger(__name__) git/util.py:107:log = logging.getLogger(__name__) ``` It is unclear if this is intentional. It is easy to miss one (see #666) so it may well be an unintended omission. I believe one of the following changes should be made, but I do not know which: - State in a comment (or docstring) in `git.repo.base` why its logger is special. - Register a `NullHandler` for the `git.repo.base` logger. - Stop registering `NullHandler`s for the other loggers. I am not sure if causing messages from GitPython, even of `WARNING` and higher severity, not to appear by default is actually considered desirable. The `NullHandler`s were introduced in #300. At that time, this was not with the goal of suppressing messages, but instead to avoid "No handlers could be found for logger" errors. It is no longer necessary to do that [since Python 3.2](https://docs.python.org/3/howto/logging.html#what-happens-if-no-configuration-is-provided). So if the only reason is as given in #300 and suppressing messages is not itself a goal, then the `NullHandler`s should be removed, unless it is considered important to keep them for compatibility with previous expected behavior of GitPython. Other than the first approach of adding a comment, any changes could be inconvenient to developers of programs or other libraries that use GitPython, and to users of such software. I am unsure if they could reasonably be considered breaking. I am inclined to think that most such changes would be non-breaking but still should not be undertaken without carefully considering the impact on users and developers who may expect the current behavior.