From 00ed38f62ed9d4509ae8579388d52f5e34147429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sun, 25 Nov 2012 17:49:03 +0100 Subject: gbp.log: Improve error message on broken color lists --- gbp/log.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gbp/log.py') diff --git a/gbp/log.py b/gbp/log.py index b9950565..88bd913a 100644 --- a/gbp/log.py +++ b/gbp/log.py @@ -144,6 +144,11 @@ def _parse_color_scheme(color_scheme=""): scheme = {} colors = color_scheme.split(':') levels = (DEBUG, INFO, WARNING, ERROR) + + if color_scheme and len(colors) != len(levels): + raise ValueError("Number color fields in color scheme not %d'" + % len(levels)) + for field, color in enumerate(colors): level = levels[field] try: -- cgit v1.2.3