diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-12-17 11:49:31 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:52 +0000 |
commit | 760b82e7320ce5dbf295df6811b04bd0594fd516 (patch) | |
tree | af6cc359efc9380cde07d40e7c344a11c6cb60ea /bitbake/lib/bb/msg.py | |
parent | 93e20c51c4cbb345119b83a964409932af417df3 (diff) | |
download | openembedded-core-contrib-760b82e7320ce5dbf295df6811b04bd0594fd516.tar.gz |
Fix logging level names for post-server-ui-split
(Bitbake rev: dc5a5c39291ec223cd761dce59d29eee7316cb70)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/msg.py')
-rw-r--r-- | bitbake/lib/bb/msg.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 36d7060b1c..badc371ce1 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/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: |