diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-13 22:52:02 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-13 22:52:02 +0000 |
commit | 4685f9874613c62092c1298fb2a19b4810daa1ea (patch) | |
tree | ee585e8f575f4db8c7ffa9939edbc3dbbb674264 /lib/bb/msg.py | |
parent | 26dc3ba77e318dd370008e5d9f0be8091e14a9b5 (diff) | |
download | bitbake-4685f9874613c62092c1298fb2a19b4810daa1ea.tar.gz |
msg.py: Add plain message type, remove legacy logging code
Diffstat (limited to 'lib/bb/msg.py')
-rw-r--r-- | lib/bb/msg.py | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py index 98cb6e6bf..56ed56dc4 100644 --- a/lib/bb/msg.py +++ b/lib/bb/msg.py @@ -66,6 +66,9 @@ class MsgError(MsgBase): class MsgFatal(MsgBase): """Fatal Message""" +class MsgPlain(MsgBase): + """General output""" + # # Message control functions # @@ -87,51 +90,36 @@ def set_debug_domains(domains): bb.msg.debug_level[ddomain] = bb.msg.debug_level[ddomain] + 1 found = True if not found: - std_warn("Logging domain %s is not valid, ignoring" % domain) + bb.msg.warn(None, "Logging domain %s is not valid, ignoring" % domain) # # Message handling functions # def debug(level, domain, msg, fn = None): + bb.event.fire(MsgDebug(msg, None)) if debug_level[domain] >= level: - bb.event.fire(MsgDebug(msg, None)) print 'DEBUG: ' + msg def note(level, domain, msg, fn = None): + bb.event.fire(MsgNote(msg, None)) if level == 1 or verbose or debug_level[domain] >= 1: - std_note(msg) + print 'NOTE: ' + msg def warn(domain, msg, fn = None): - std_warn(msg) - -def error(domain, msg, fn = None): - std_error(msg) - -def fatal(domain, msg, fn = None): - std_fatal(msg) - -# -# Compatibility functions for the original message interface -# -def std_debug(lvl, msg): - if debug_level['default'] >= lvl: - bb.event.fire(MsgDebug(msg, None)) - print 'DEBUG: ' + msg - -def std_note(msg): - bb.event.fire(MsgNote(msg, None)) - print 'NOTE: ' + msg - -def std_warn(msg): bb.event.fire(MsgWarn(msg, None)) print 'WARNING: ' + msg -def std_error(msg): +def error(domain, msg, fn = None): bb.event.fire(MsgError(msg, None)) print 'ERROR: ' + msg -def std_fatal(msg): +def fatal(domain, msg, fn = None): bb.event.fire(MsgFatal(msg, None)) print 'ERROR: ' + msg sys.exit(1) + +def plain(domain, msg): + bb.event.fire(MsgPlain(msg, None), fn = None) + print msg + |