summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/msg.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/msg.py')
-rw-r--r--bitbake/lib/bb/msg.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index a1b31e5d60..3fcf7091be 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -22,8 +22,8 @@ Message handling infrastructure for bitbake
22# with this program; if not, write to the Free Software Foundation, Inc., 22# with this program; if not, write to the Free Software Foundation, Inc.,
23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 24
25import sys, os, re, bb 25import sys, bb
26from bb import utils, event 26from bb import event
27 27
28debug_level = {} 28debug_level = {}
29 29
@@ -47,9 +47,9 @@ domain = bb.utils.Enum(
47class MsgBase(bb.event.Event): 47class MsgBase(bb.event.Event):
48 """Base class for messages""" 48 """Base class for messages"""
49 49
50 def __init__(self, msg, d ): 50 def __init__(self, msg):
51 self._message = msg 51 self._message = msg
52 event.Event.__init__(self, d) 52 event.Event.__init__(self)
53 53
54class MsgDebug(MsgBase): 54class MsgDebug(MsgBase):
55 """Debug Message""" 55 """Debug Message"""
@@ -97,33 +97,29 @@ def set_debug_domains(domains):
97# 97#
98 98
99def debug(level, domain, msg, fn = None): 99def debug(level, domain, msg, fn = None):
100 bb.event.fire(MsgDebug(msg, None))
101 if not domain: 100 if not domain:
102 domain = 'default' 101 domain = 'default'
103 if debug_level[domain] >= level: 102 if debug_level[domain] >= level:
104 print 'DEBUG: ' + msg 103 bb.event.fire(MsgDebug(msg), None)
105 104
106def note(level, domain, msg, fn = None): 105def note(level, domain, msg, fn = None):
107 bb.event.fire(MsgNote(msg, None))
108 if not domain: 106 if not domain:
109 domain = 'default' 107 domain = 'default'
110 if level == 1 or verbose or debug_level[domain] >= 1: 108 if level == 1 or verbose or debug_level[domain] >= 1:
111 print 'NOTE: ' + msg 109 bb.event.fire(MsgNote(msg), None)
112 110
113def warn(domain, msg, fn = None): 111def warn(domain, msg, fn = None):
114 bb.event.fire(MsgWarn(msg, None)) 112 bb.event.fire(MsgWarn(msg), None)
115 print 'WARNING: ' + msg
116 113
117def error(domain, msg, fn = None): 114def error(domain, msg, fn = None):
118 bb.event.fire(MsgError(msg, None)) 115 bb.event.fire(MsgError(msg), None)
119 print 'ERROR: ' + msg 116 print 'ERROR: ' + msg
120 117
121def fatal(domain, msg, fn = None): 118def fatal(domain, msg, fn = None):
122 bb.event.fire(MsgFatal(msg, None)) 119 bb.event.fire(MsgFatal(msg), None)
123 print 'ERROR: ' + msg 120 print 'FATAL: ' + msg
124 sys.exit(1) 121 sys.exit(1)
125 122
126def plain(msg, fn = None): 123def plain(msg, fn = None):
127 bb.event.fire(MsgPlain(msg, None)) 124 bb.event.fire(MsgPlain(msg), None)
128 print msg
129 125