diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-07 14:49:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-07 14:50:27 +0000 |
commit | 7586adb360d8075d3e97184dfcafb1b13ce5f838 (patch) | |
tree | 8c07c976f6dde6329511fa0ecc5cd877dd0468ef /bitbake/lib | |
parent | ded83ffc3bd86553c9b540795660985905c925ba (diff) | |
download | openembedded-core-7586adb360d8075d3e97184dfcafb1b13ce5f838.tar.gz openembedded-core-7586adb360d8075d3e97184dfcafb1b13ce5f838.tar.bz2 openembedded-core-7586adb360d8075d3e97184dfcafb1b13ce5f838.tar.xz openembedded-core-7586adb360d8075d3e97184dfcafb1b13ce5f838.zip |
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')
-rw-r--r-- | bitbake/lib/bb/msg.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 9d26fa06b..1f9ff904a 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py @@ -33,6 +33,8 @@ import bb.event class BBLogFormatter(logging.Formatter): """Formatter which ensures that our 'plain' messages (logging.INFO + 1) are used as is""" + DEBUG3 = logging.DEBUG - 2 + DEBUG2 = logging.DEBUG - 1 DEBUG = logging.DEBUG VERBOSE = logging.INFO - 1 NOTE = logging.INFO @@ -42,10 +44,12 @@ class BBLogFormatter(logging.Formatter): CRITICAL = logging.CRITICAL levelnames = { + DEBUG3 : 'DEBUG', + DEBUG2 : 'DEBUG', DEBUG : 'DEBUG', - PLAIN : '', - NOTE : 'NOTE', VERBOSE: 'NOTE', + NOTE : 'NOTE', + PLAIN : '', WARNING : 'WARNING', ERROR : 'ERROR', CRITICAL: 'ERROR', @@ -60,7 +64,7 @@ class BBLogFormatter(logging.Formatter): def format(self, record): record.levelname = self.getLevelName(record.levelno) - if record.levelno == logging.INFO + 1: + if record.levelno == self.PLAIN: return record.getMessage() else: return logging.Formatter.format(self, record) @@ -123,9 +127,9 @@ def get_debug_level(msgdomain = domain.Default): def set_verbose(level): if level: - logger.setLevel(logging.INFO - 1) + logger.setLevel(BBLogFormatter.VERBOSE) else: - logger.setLevel(logging.INFO) + logger.setLevel(BBLogFormatter.INFO) def set_debug_domains(domainargs): for (domainarg, iterator) in groupby(domainargs): |