diff options
Diffstat (limited to 'bitbake/lib/bb/msg.py')
-rw-r--r-- | bitbake/lib/bb/msg.py | 26 |
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 | ||
25 | import sys, os, re, bb | 25 | import sys, bb |
26 | from bb import utils, event | 26 | from bb import event |
27 | 27 | ||
28 | debug_level = {} | 28 | debug_level = {} |
29 | 29 | ||
@@ -47,9 +47,9 @@ domain = bb.utils.Enum( | |||
47 | class MsgBase(bb.event.Event): | 47 | class 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 | ||
54 | class MsgDebug(MsgBase): | 54 | class MsgDebug(MsgBase): |
55 | """Debug Message""" | 55 | """Debug Message""" |
@@ -97,33 +97,29 @@ def set_debug_domains(domains): | |||
97 | # | 97 | # |
98 | 98 | ||
99 | def debug(level, domain, msg, fn = None): | 99 | def 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 | ||
106 | def note(level, domain, msg, fn = None): | 105 | def 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 | ||
113 | def warn(domain, msg, fn = None): | 111 | def 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 | ||
117 | def error(domain, msg, fn = None): | 114 | def 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 | ||
121 | def fatal(domain, msg, fn = None): | 118 | def 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 | ||
126 | def plain(msg, fn = None): | 123 | def plain(msg, fn = None): |
127 | bb.event.fire(MsgPlain(msg, None)) | 124 | bb.event.fire(MsgPlain(msg), None) |
128 | print msg | ||
129 | 125 | ||