log: prefix output with logger name if --debug is specified
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 21 Nov 2012 07:28:56 +0000 (09:28 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 7 Dec 2012 08:51:24 +0000 (10:51 +0200)
Helps to identify gbs and gbp log output when debugging.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gitbuildsys/cmd_export.py
gitbuildsys/cmd_import.py
gitbuildsys/log.py

index dd1d44338cb853f1680ba4ef53b2ccc6d8a6b283..d9ab94c77e20e26033b9152a66fe8dc60928f767 100644 (file)
@@ -152,6 +152,8 @@ def create_gbp_export_args(repo, commit, export_dir, tmp_dir, spec, args,
             "--git-upstream-tag=%s" % upstream_tag,
             "--git-spec-vcs-tag=%s#%%(tagname)s" % reponame]
 
+    if args.debug:
+        argv.append("--git-verbose")
     if force_native or is_native_pkg(repo, args):
         argv.extend(["--git-no-patch-export",
                      "--git-upstream-tree=%s" % commit])
index cf1aa4e9719eb1aa6a752b25834aa173c330f0ad..ba23589a32b6a2ccd1ed608f1bc2a528a68d5910 100644 (file)
@@ -49,6 +49,8 @@ def main(args):
               "--upstream-branch=%s" % args.upstream_branch, path,
               "--tmp-dir=%s" % tmp.path,
               ]
+    if args.debug:
+        params.append("--verbose")
     if not args.no_pristine_tar and os.path.exists("/usr/bin/pristine-tar"):
         params.append("--pristine-tar")
 
index 015725c264cdf65b9346d51b1a41c4e34fd74f22..18c30fb7c73726db0f414dd8afa0371d0acd379d 100644 (file)
@@ -70,7 +70,10 @@ def setup(verbose, debug=False):
         LOGGER.setLevel(INFO)
 
     # Set output format
-    log_fmt = '%(color)s%(levelname)s: %(coloroff)s%(message)s'
+    if debug:
+        log_fmt = '%(color)s%(name)s:%(levelname)s: %(coloroff)s%(message)s'
+    else:
+        log_fmt = '%(color)s%(levelname)s: %(coloroff)s%(message)s'
     LOGGER.set_format(log_fmt)
     gbp.log.LOGGER.set_format(log_fmt)