summaryrefslogtreecommitdiff
path: root/gbp/log.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-02-17 12:51:34 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-02-17 12:56:42 +0200
commit4a6efd0a6276151f336b300235910e7443904efd (patch)
tree95b11362e66e9260ffb5ad2dfcdbdff25bda869c /gbp/log.py
parent933fa3d4a4aeb20f9ebbdde519f5cdebfdad92cd (diff)
downloadgit-buildpackage-4a6efd0a6276151f336b300235910e7443904efd.tar.gz
git-buildpackage-4a6efd0a6276151f336b300235910e7443904efd.tar.bz2
git-buildpackage-4a6efd0a6276151f336b300235910e7443904efd.zip
log: don't crash getLogger if getting the root logger
The root logger won't have the gbp-specific default_handlers attribute. Change-Id: I0b81fdfbe70fe16ce3fd226248b83a4f6a17fc7f Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/log.py')
-rw-r--r--gbp/log.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gbp/log.py b/gbp/log.py
index a508b677..7b9a4aa8 100644
--- a/gbp/log.py
+++ b/gbp/log.py
@@ -176,7 +176,7 @@ def getLogger(*args, **kwargs):
logging.setLoggerClass(GbpLogger)
color = kwargs.pop('color') if 'color' in kwargs else 'auto'
logger = logging.getLogger(*args, **kwargs)
- if not logger.default_handlers:
+ if hasattr(logger, 'default_handlers') and not logger.default_handlers:
logger.init_default_handlers(color)
return logger