|
6 | 6 |
|
7 | 7 | import os
|
8 | 8 | import sys
|
| 9 | +import logging |
9 | 10 | from util import (
|
10 | 11 | LazyMixin,
|
11 | 12 | stream_copy
|
|
22 | 23 | 'with_exceptions', 'as_process',
|
23 | 24 | 'output_stream')
|
24 | 25 |
|
| 26 | +log = logging.getLogger('git.cmd') |
| 27 | + |
25 | 28 | __all__ = ('Git', )
|
26 | 29 |
|
27 | 30 |
|
@@ -334,7 +337,7 @@ def execute(self, command,
|
334 | 337 | If you add additional keyword arguments to the signature of this method,
|
335 | 338 | you must update the execute_kwargs tuple housed in this module."""
|
336 | 339 | if self.GIT_PYTHON_TRACE and (self.GIT_PYTHON_TRACE != 'full' or as_process):
|
337 |
| - print(' '.join(command)) |
| 340 | + log.info(' '.join(command)) |
338 | 341 |
|
339 | 342 | # Allow the user to have the command executed in their working dir.
|
340 | 343 | if with_keep_cwd or self._working_dir is None:
|
@@ -389,11 +392,11 @@ def execute(self, command,
|
389 | 392 | if self.GIT_PYTHON_TRACE == 'full':
|
390 | 393 | cmdstr = " ".join(command)
|
391 | 394 | if stderr_value:
|
392 |
| - print("%s -> %d; stdout: '%s'; stderr: '%s'" % (cmdstr, status, stdout_value, stderr_value)) |
| 395 | + log.info("%s -> %d; stdout: '%s'; stderr: '%s'", cmdstr, status, stdout_value, stderr_value) |
393 | 396 | elif stdout_value:
|
394 |
| - print("%s -> %d; stdout: '%s'" % (cmdstr, status, stdout_value)) |
| 397 | + log.info("%s -> %d; stdout: '%s'", cmdstr, status, stdout_value) |
395 | 398 | else:
|
396 |
| - print("%s -> %d" % (cmdstr, status)) |
| 399 | + log.info("%s -> %d", cmdstr, status) |
397 | 400 | # END handle debug printing
|
398 | 401 |
|
399 | 402 | if with_exceptions and status != 0:
|
|
0 commit comments