From 7371e6323c3fb6b0545712e3cf84606644073e77 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 1 Apr 2007 15:04:49 +0000 Subject: bitbake: Update to 1.8.1 (inc. various bug fixes, epoch support) git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1419 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- bitbake/lib/bb/msg.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/msg.py') diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index bd7729731..71b0b05b7 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py @@ -23,7 +23,7 @@ Message handling infrastructure for bitbake # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import sys, os, re, bb -from bb import utils +from bb import utils, event debug_level = {} @@ -42,6 +42,29 @@ domain = bb.utils.Enum( 'TaskData', 'Util') + +class MsgBase(bb.event.Event): + """Base class for messages""" + + def __init__(self, msg, d ): + self._message = msg + event.Event.__init__(self, d) + +class MsgDebug(MsgBase): + """Debug Message""" + +class MsgNote(MsgBase): + """Note Message""" + +class MsgWarn(MsgBase): + """Warning Message""" + +class MsgError(MsgBase): + """Error Message""" + +class MsgFatal(MsgBase): + """Fatal Message""" + # # Message control functions # @@ -71,6 +94,7 @@ def set_debug_domains(domains): def debug(level, domain, msg, fn = None): if debug_level[domain] >= level: + bb.event.fire(MsgDebug(msg, None)) print 'DEBUG: ' + msg def note(level, domain, msg, fn = None): @@ -91,17 +115,22 @@ def fatal(domain, msg, fn = None): # 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): + bb.event.fire(MsgError(msg, None)) print 'ERROR: ' + msg def std_fatal(msg): + bb.event.fire(MsgFatal(msg, None)) print 'ERROR: ' + msg sys.exit(1) -- cgit v1.2.3