From 987dbf4a0f06c7933496739fbbcd083af4f25159 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 25 Jan 2024 21:19:13 -0500 Subject: [PATCH] Use consistent style for passing logger name This has each module use `__name__` for the path to its own logger. Previously, most modules did this several hard-coded their names in calls to logging.getLogger. --- git/config.py | 2 +- git/objects/commit.py | 2 +- git/objects/submodule/base.py | 2 +- git/objects/submodule/root.py | 2 +- git/remote.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/git/config.py b/git/config.py index 2730ddaf3..48319e537 100644 --- a/git/config.py +++ b/git/config.py @@ -61,7 +61,7 @@ __all__ = ("GitConfigParser", "SectionConstraint") -log = logging.getLogger("git.config") +log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) diff --git a/git/objects/commit.py b/git/objects/commit.py index 5a069848c..774e322fc 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -52,7 +52,7 @@ # ------------------------------------------------------------------------ -log = logging.getLogger("git.objects.commit") +log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) __all__ = ("Commit",) diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index c3d353141..585037653 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -56,7 +56,7 @@ __all__ = ["Submodule", "UpdateProgress"] -log = logging.getLogger("git.objects.submodule.base") +log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py index d9d9f6d24..db60abf8b 100644 --- a/git/objects/submodule/root.py +++ b/git/objects/submodule/root.py @@ -22,7 +22,7 @@ __all__ = ["RootModule", "RootUpdateProgress"] -log = logging.getLogger("git.objects.submodule.root") +log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) diff --git a/git/remote.py b/git/remote.py index 98a421b3a..e33add1d1 100644 --- a/git/remote.py +++ b/git/remote.py @@ -65,7 +65,7 @@ # ------------------------------------------------------------- -log = logging.getLogger("git.remote") +log = logging.getLogger(__name__) log.addHandler(logging.NullHandler())