summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-04 15:39:28 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-04 15:39:28 +0100
commit6f55c17f48d7608072199496fbcefa33f2e97bf0 (patch)
treed6c69f667f3cce87d3fe5bf9baa62a081f4af7a8 /git/cmd.py
parent1b9d3b961bdf79964b883d3179f085d8835e528d (diff)
downloadgitpython-6f55c17f48d7608072199496fbcefa33f2e97bf0.tar.gz
Replaced ordered dict with standard version; used logging module
All performance tests still print to stderr, but do so in a py3 compatible way
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/git/cmd.py b/git/cmd.py
index d024b409..c355eacf 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -6,6 +6,7 @@
import os
import sys
+import logging
from util import (
LazyMixin,
stream_copy
@@ -22,6 +23,8 @@ execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output',
'with_exceptions', 'as_process',
'output_stream')
+log = logging.getLogger('git.cmd')
+
__all__ = ('Git', )
@@ -334,7 +337,7 @@ class Git(LazyMixin):
If you add additional keyword arguments to the signature of this method,
you must update the execute_kwargs tuple housed in this module."""
if self.GIT_PYTHON_TRACE and (self.GIT_PYTHON_TRACE != 'full' or as_process):
- print(' '.join(command))
+ log.info(' '.join(command))
# Allow the user to have the command executed in their working dir.
if with_keep_cwd or self._working_dir is None:
@@ -389,11 +392,11 @@ class Git(LazyMixin):
if self.GIT_PYTHON_TRACE == 'full':
cmdstr = " ".join(command)
if stderr_value:
- print("%s -> %d; stdout: '%s'; stderr: '%s'" % (cmdstr, status, stdout_value, stderr_value))
+ log.info("%s -> %d; stdout: '%s'; stderr: '%s'", cmdstr, status, stdout_value, stderr_value)
elif stdout_value:
- print("%s -> %d; stdout: '%s'" % (cmdstr, status, stdout_value))
+ log.info("%s -> %d; stdout: '%s'", cmdstr, status, stdout_value)
else:
- print("%s -> %d" % (cmdstr, status))
+ log.info("%s -> %d", cmdstr, status)
# END handle debug printing
if with_exceptions and status != 0: