summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/msg.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 14:49:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 14:50:27 +0000
commit7586adb360d8075d3e97184dfcafb1b13ce5f838 (patch)
tree8c07c976f6dde6329511fa0ecc5cd877dd0468ef /bitbake/lib/bb/msg.py
parentded83ffc3bd86553c9b540795660985905c925ba (diff)
downloadpoky-7586adb360d8075d3e97184dfcafb1b13ce5f838.tar.gz
bitbake/msg: Ensure lower level debug messages have DEBUG prefix and reuse log level values from formatter
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/msg.py')
-rw-r--r--bitbake/lib/bb/msg.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 9d26fa06bd..1f9ff904af 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -33,6 +33,8 @@ import bb.event
33class BBLogFormatter(logging.Formatter): 33class BBLogFormatter(logging.Formatter):
34 """Formatter which ensures that our 'plain' messages (logging.INFO + 1) are used as is""" 34 """Formatter which ensures that our 'plain' messages (logging.INFO + 1) are used as is"""
35 35
36 DEBUG3 = logging.DEBUG - 2
37 DEBUG2 = logging.DEBUG - 1
36 DEBUG = logging.DEBUG 38 DEBUG = logging.DEBUG
37 VERBOSE = logging.INFO - 1 39 VERBOSE = logging.INFO - 1
38 NOTE = logging.INFO 40 NOTE = logging.INFO
@@ -42,10 +44,12 @@ class BBLogFormatter(logging.Formatter):
42 CRITICAL = logging.CRITICAL 44 CRITICAL = logging.CRITICAL
43 45
44 levelnames = { 46 levelnames = {
47 DEBUG3 : 'DEBUG',
48 DEBUG2 : 'DEBUG',
45 DEBUG : 'DEBUG', 49 DEBUG : 'DEBUG',
46 PLAIN : '',
47 NOTE : 'NOTE',
48 VERBOSE: 'NOTE', 50 VERBOSE: 'NOTE',
51 NOTE : 'NOTE',
52 PLAIN : '',
49 WARNING : 'WARNING', 53 WARNING : 'WARNING',
50 ERROR : 'ERROR', 54 ERROR : 'ERROR',
51 CRITICAL: 'ERROR', 55 CRITICAL: 'ERROR',
@@ -60,7 +64,7 @@ class BBLogFormatter(logging.Formatter):
60 64
61 def format(self, record): 65 def format(self, record):
62 record.levelname = self.getLevelName(record.levelno) 66 record.levelname = self.getLevelName(record.levelno)
63 if record.levelno == logging.INFO + 1: 67 if record.levelno == self.PLAIN:
64 return record.getMessage() 68 return record.getMessage()
65 else: 69 else:
66 return logging.Formatter.format(self, record) 70 return logging.Formatter.format(self, record)
@@ -123,9 +127,9 @@ def get_debug_level(msgdomain = domain.Default):
123 127
124def set_verbose(level): 128def set_verbose(level):
125 if level: 129 if level:
126 logger.setLevel(logging.INFO - 1) 130 logger.setLevel(BBLogFormatter.VERBOSE)
127 else: 131 else:
128 logger.setLevel(logging.INFO) 132 logger.setLevel(BBLogFormatter.INFO)
129 133
130def set_debug_domains(domainargs): 134def set_debug_domains(domainargs):
131 for (domainarg, iterator) in groupby(domainargs): 135 for (domainarg, iterator) in groupby(domainargs):