diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-06-26 09:18:57 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-06-26 09:18:57 +0200 |
commit | 8724dfa6bf8f6de9c36d10b9b52ab8a1ea30c3b2 (patch) | |
tree | 59bd270c549bf4e516c613354658c028ce66c1a1 /git | |
parent | 640d1506e7f259d675976e7fffcbc854d41d4246 (diff) | |
parent | d1a9a232fbde88a347935804721ec7cd08de6f65 (diff) | |
download | gitpython-8724dfa6bf8f6de9c36d10b9b52ab8a1ea30c3b2.tar.gz |
Merge branch 'missionfocus-loggingNullHandlers'
Diffstat (limited to 'git')
-rw-r--r-- | git/cmd.py | 1 | ||||
-rw-r--r-- | git/config.py | 1 | ||||
-rw-r--r-- | git/objects/commit.py | 1 | ||||
-rw-r--r-- | git/objects/submodule/base.py | 1 | ||||
-rw-r--r-- | git/objects/submodule/root.py | 1 | ||||
-rw-r--r-- | git/util.py | 10 |
6 files changed, 15 insertions, 0 deletions
@@ -44,6 +44,7 @@ execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', 'output_stream') log = logging.getLogger('git.cmd') +log.addHandler(logging.NullHandler()) __all__ = ('Git', ) diff --git a/git/config.py b/git/config.py index a6a25c7b..2d9adbdd 100644 --- a/git/config.py +++ b/git/config.py @@ -32,6 +32,7 @@ __all__ = ('GitConfigParser', 'SectionConstraint') log = logging.getLogger('git.config') +log.addHandler(logging.NullHandler()) class MetaParserBuilder(abc.ABCMeta): diff --git a/git/objects/commit.py b/git/objects/commit.py index ac381cd9..d301e301 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -34,6 +34,7 @@ from io import BytesIO import logging log = logging.getLogger('git.objects.commit') +log.addHandler(logging.NullHandler()) __all__ = ('Commit', ) diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index f9b0b6ad..30201e09 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -43,6 +43,7 @@ __all__ = ["Submodule", "UpdateProgress"] log = logging.getLogger('git.objects.submodule.base') +log.addHandler(logging.NullHandler()) class UpdateProgress(RemoteProgress): diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py index 1c863f6f..4fe856c2 100644 --- a/git/objects/submodule/root.py +++ b/git/objects/submodule/root.py @@ -13,6 +13,7 @@ import logging __all__ = ["RootModule", "RootUpdateProgress"] log = logging.getLogger('git.objects.submodule.root') +log.addHandler(logging.NullHandler()) class RootUpdateProgress(UpdateProgress): diff --git a/git/util.py b/git/util.py index fb459da1..f0a08e79 100644 --- a/git/util.py +++ b/git/util.py @@ -13,6 +13,7 @@ import shutil import platform import getpass import threading +import logging # NOTE: Some of the unused imports might be used/imported by others. # Handle once test-cases are back up and running. @@ -753,3 +754,12 @@ class WaitGroup(object): while self.count > 0: self.cv.wait() self.cv.release() + + +class NullHandler(logging.Handler): + def emit(self, record): + pass + +# In Python 2.6, there is no NullHandler yet. Let's monkey-patch it for a workaround. +if not hasattr(logging, 'NullHandler'): + logging.NullHandler = NullHandler |