summaryrefslogtreecommitdiffstats
path: root/lib/bb/msg.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-17 11:49:31 -0700
committerChris Larson <chris_larson@mentor.com>2010-12-17 11:52:24 -0700
commitdc5a5c39291ec223cd761dce59d29eee7316cb70 (patch)
tree3cba379c344de1a2239bff37b57ccee861bed795 /lib/bb/msg.py
parent71f8b122dc8477b12911ff7b145a42c4c97a118f (diff)
downloadbitbake-dc5a5c39291ec223cd761dce59d29eee7316cb70.tar.gz
Fix logging level names for post-server-ui-split
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/msg.py')
-rw-r--r--lib/bb/msg.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index 0c1fa3bfc..13ee569e9 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -33,7 +33,28 @@ import bb.event
class BBLogFormatter(logging.Formatter):
"""Formatter which ensures that our 'plain' messages (logging.INFO + 1) are used as is"""
+ VERBOSE = 19
+ PLAIN = 21
+ levelnames = {
+ PLAIN : '',
+ VERBOSE: 'NOTE',
+
+ logging.DEBUG : 'DEBUG',
+ logging.INFO : 'NOTE',
+ logging.WARNING : 'WARNING',
+ logging.ERROR : 'ERROR',
+ logging.CRITICAL: 'ERROR',
+ }
+
+ def getLevelName(self, levelno):
+ try:
+ return self.levelnames[levelno]
+ except KeyError:
+ self.levelnames[levelno] = value = 'Level %d' % levelno
+ return value
+
def format(self, record):
+ record.levelname = self.getLevelName(record.levelno)
if record.levelno == logging.INFO + 1:
return record.getMessage()
else: