diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-09-03 13:07:10 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-11-16 13:27:28 +0100 |
commit | 7e79bcd4ab0030db5c5a7998c81f63c48656be80 (patch) | |
tree | 89e8281c518e2ce705d99c3fc1f17aac30ae0124 /gbp/command_wrappers.py | |
parent | c385e767dc713ae8b2d32374cd94d2dc3eae2b6e (diff) |
Add logging functions
This allows us to color and prefix the output.
Closes: #544332
Diffstat (limited to 'gbp/command_wrappers.py')
-rw-r--r-- | gbp/command_wrappers.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py index f500eeef..60a317f8 100644 --- a/gbp/command_wrappers.py +++ b/gbp/command_wrappers.py @@ -11,6 +11,7 @@ import sys import os import os.path import signal +import log from errors import GbpError class CommandExecFailed(Exception): @@ -23,8 +24,6 @@ class Command(object): Wraps a shell command, so we don't have to store any kind of command line options in one of the git-buildpackage commands """ - verbose = False - def __init__(self, cmd, args=[], shell=False, extra_env=None): self.cmd = cmd self.args = args @@ -42,8 +41,7 @@ class Command(object): "restore default signal handler (http://bugs.python.org/issue1652)" signal.signal(signal.SIGPIPE, signal.SIG_DFL) - if self.verbose: - print self.cmd, self.args, args + log.debug("%s %s %s" % (self.cmd, self.args, args)) cmd = [ self.cmd ] + self.args + args if self.shell: # subprocess.call only cares about the first argument if shell=True cmd = " ".join(cmd) |