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.py44
1 files changed, 18 insertions, 26 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 98cb6e6bf3..a1b31e5d60 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -66,6 +66,9 @@ class MsgError(MsgBase):
66class MsgFatal(MsgBase): 66class MsgFatal(MsgBase):
67 """Fatal Message""" 67 """Fatal Message"""
68 68
69class MsgPlain(MsgBase):
70 """General output"""
71
69# 72#
70# Message control functions 73# Message control functions
71# 74#
@@ -87,51 +90,40 @@ def set_debug_domains(domains):
87 bb.msg.debug_level[ddomain] = bb.msg.debug_level[ddomain] + 1 90 bb.msg.debug_level[ddomain] = bb.msg.debug_level[ddomain] + 1
88 found = True 91 found = True
89 if not found: 92 if not found:
90 std_warn("Logging domain %s is not valid, ignoring" % domain) 93 bb.msg.warn(None, "Logging domain %s is not valid, ignoring" % domain)
91 94
92# 95#
93# Message handling functions 96# Message handling functions
94# 97#
95 98
96def debug(level, domain, msg, fn = None): 99def debug(level, domain, msg, fn = None):
100 bb.event.fire(MsgDebug(msg, None))
101 if not domain:
102 domain = 'default'
97 if debug_level[domain] >= level: 103 if debug_level[domain] >= level:
98 bb.event.fire(MsgDebug(msg, None))
99 print 'DEBUG: ' + msg 104 print 'DEBUG: ' + msg
100 105
101def note(level, domain, msg, fn = None): 106def note(level, domain, msg, fn = None):
107 bb.event.fire(MsgNote(msg, None))
108 if not domain:
109 domain = 'default'
102 if level == 1 or verbose or debug_level[domain] >= 1: 110 if level == 1 or verbose or debug_level[domain] >= 1:
103 std_note(msg) 111 print 'NOTE: ' + msg
104 112
105def warn(domain, msg, fn = None): 113def warn(domain, msg, fn = None):
106 std_warn(msg)
107
108def error(domain, msg, fn = None):
109 std_error(msg)
110
111def fatal(domain, msg, fn = None):
112 std_fatal(msg)
113
114#
115# Compatibility functions for the original message interface
116#
117def std_debug(lvl, msg):
118 if debug_level['default'] >= lvl:
119 bb.event.fire(MsgDebug(msg, None))
120 print 'DEBUG: ' + msg
121
122def std_note(msg):
123 bb.event.fire(MsgNote(msg, None))
124 print 'NOTE: ' + msg
125
126def std_warn(msg):
127 bb.event.fire(MsgWarn(msg, None)) 114 bb.event.fire(MsgWarn(msg, None))
128 print 'WARNING: ' + msg 115 print 'WARNING: ' + msg
129 116
130def std_error(msg): 117def error(domain, msg, fn = None):
131 bb.event.fire(MsgError(msg, None)) 118 bb.event.fire(MsgError(msg, None))
132 print 'ERROR: ' + msg 119 print 'ERROR: ' + msg
133 120
134def std_fatal(msg): 121def fatal(domain, msg, fn = None):
135 bb.event.fire(MsgFatal(msg, None)) 122 bb.event.fire(MsgFatal(msg, None))
136 print 'ERROR: ' + msg 123 print 'ERROR: ' + msg
137 sys.exit(1) 124 sys.exit(1)
125
126def plain(msg, fn = None):
127 bb.event.fire(MsgPlain(msg, None))
128 print msg
129