aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-12-26 20:15:17 +0100
committerGuido Günther <agx@sigxcpu.org>2016-12-26 20:15:17 +0100
commit73e1bca3b37db06dcf5d3a36472a0b78e2f20338 (patch)
tree10b25f6bf5a8a17269566e234a660020582a3e24
parent9e44a205fbec7fd83ff4c41fa17a7e4c049ef1ba (diff)
Use compact forms of logging functions
-rw-r--r--gbp/log.py8
-rwxr-xr-xgbp/scripts/buildpackage.py4
-rwxr-xr-xgbp/scripts/config.py4
-rw-r--r--gbp/scripts/create_remote_repo.py4
-rw-r--r--gbp/scripts/import_orig.py8
-rw-r--r--gbp/scripts/rpm_ch.py2
6 files changed, 11 insertions, 19 deletions
diff --git a/gbp/log.py b/gbp/log.py
index ae4821d6..55c9b095 100644
--- a/gbp/log.py
+++ b/gbp/log.py
@@ -125,19 +125,11 @@ def err(msg):
LOGGER.error(msg)
-def error(msg):
- err(msg)
-
-
def warn(msg):
"""Logs a message with level WARNING on the GBP logger"""
LOGGER.warning(msg)
-def warning(msg):
- warn(msg)
-
-
def info(msg):
"""Logs a message with level INFO on the GBP logger"""
LOGGER.info(msg)
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index a0efa42d..43c5da4c 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -620,11 +620,11 @@ def parse_args(argv, prefix):
# --git-dont-purge is deprecated:
if options.dont_purge:
- gbp.log.warning("--git-dont-purge is depreceted, use --git-no-purge instead")
+ gbp.log.warn("--git-dont-purge is depreceted, use --git-no-purge instead")
options.purge = False
if options.components and options.pristine_tar_commit:
- gbp.log.warning("Components specified, pristine-tar-commit not yet supported - disabling it.")
+ gbp.log.warn("Components specified, pristine-tar-commit not yet supported - disabling it.")
options.pristine_tar_commit = False
return options, args, dpkg_args
diff --git a/gbp/scripts/config.py b/gbp/scripts/config.py
index 1a9be3e0..3dbf7e69 100755
--- a/gbp/scripts/config.py
+++ b/gbp/scripts/config.py
@@ -124,10 +124,10 @@ def main(argv):
gbp.log.setup(options.color, options.verbose, options.color_scheme)
if not args:
- gbp.log.error("No command given")
+ gbp.log.err("No command given")
return 2
elif len(args) != 2:
- gbp.log.error("Can only take a command or command.optionname, check --help")
+ gbp.log.err("Can only take a command or command.optionname, check --help")
return 2
else:
query = args[1]
diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py
index c05119e0..7a8ca080 100644
--- a/gbp/scripts/create_remote_repo.py
+++ b/gbp/scripts/create_remote_repo.py
@@ -389,7 +389,7 @@ def main(argv):
if len(args) == 1:
args.append('create') # the default
elif len(args) > 2:
- gbp.log.error("Only one action allowed")
+ gbp.log.err("Only one action allowed")
return 1
action = args[1]
@@ -398,7 +398,7 @@ def main(argv):
elif action == 'list':
retval = do_list(sections)
else:
- gbp.log.error("Unknown action '%s'" % action)
+ gbp.log.err("Unknown action '%s'" % action)
return retval
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 0eea6b9d..47c56d92 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -85,7 +85,7 @@ class ImportOrigDebianGitRepository(DebianGitRepository):
try:
sha = self.rev_parse(refname)
except GitRepositoryError as err:
- gbp.log.warning("Failed to rev-parse %s: %s" % (refname, err))
+ gbp.log.warn("Failed to rev-parse %s: %s" % (refname, err))
elif action == 'delete':
pass
elif action == 'abortmerge':
@@ -633,9 +633,9 @@ def main(argv):
# Make sure the very last line as an error message
gbp.log.err("Rolled back changes after import error.")
except Exception as e:
- gbp.log.error("%s" % e)
- gbp.log.error("Clean up manually and please report a bug: %s" %
- repo.rollback_errors)
+ gbp.log.err("%s" % e)
+ gbp.log.err("Clean up manually and please report a bug: %s" %
+ repo.rollback_errors)
if pristine_orig and linked and not options.symlink_orig:
os.unlink(pristine_orig)
diff --git a/gbp/scripts/rpm_ch.py b/gbp/scripts/rpm_ch.py
index 07141464..a2c4857c 100644
--- a/gbp/scripts/rpm_ch.py
+++ b/gbp/scripts/rpm_ch.py
@@ -312,7 +312,7 @@ def build_parser(name):
parser = GbpOptionParserRpm(command=os.path.basename(name),
prefix='', usage='%prog [options] paths')
except GbpError as err:
- gbp.log.error(err)
+ gbp.log.err(err)
return None
range_grp = GbpOptionGroup(parser, "commit range options",