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.py55
1 files changed, 29 insertions, 26 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index cf79314017..5fc1d5d4ad 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -34,18 +34,19 @@ def _NamedTuple(name, fields):
34 return Tuple(*range(len(fields))) 34 return Tuple(*range(len(fields)))
35 35
36domain = _NamedTuple("Domain",( 36domain = _NamedTuple("Domain",(
37 'Build', 37 "Default",
38 'Cache', 38 "Build",
39 'Collection', 39 "Cache",
40 'Data', 40 "Collection",
41 'Depends', 41 "Data",
42 'Fetcher', 42 "Depends",
43 'Parsing', 43 "Fetcher",
44 'PersistData', 44 "Parsing",
45 'Provider', 45 "PersistData",
46 'RunQueue', 46 "Provider",
47 'TaskData', 47 "RunQueue",
48 'Util')) 48 "TaskData",
49 "Util"))
49 50
50 51
51class MsgBase(bb.event.Event): 52class MsgBase(bb.event.Event):
@@ -80,13 +81,13 @@ class MsgPlain(MsgBase):
80def set_debug_level(level): 81def set_debug_level(level):
81 for d in domain: 82 for d in domain:
82 debug_level[d] = level 83 debug_level[d] = level
83 debug_level['default'] = level 84 debug_level[domain.Default] = level
84 85
85def set_verbose(level): 86def set_verbose(level):
86 verbose = level 87 verbose = level
87 88
88def set_debug_domains(domain_strings): 89def set_debug_domains(msgdomainstrings):
89 for domainstr in domain_strings: 90 for domainstr in msgdomainstrings:
90 for d in domain: 91 for d in domain:
91 if domain._fields[d] == domainstr: 92 if domain._fields[d] == domainstr:
92 debug_level[d] += 1 93 debug_level[d] += 1
@@ -98,33 +99,35 @@ def set_debug_domains(domain_strings):
98# Message handling functions 99# Message handling functions
99# 100#
100 101
101def debug(level, domain, msg, fn = None): 102def debug(level, msgdomain, msg, fn = None):
102 if not domain: 103 if not msgdomain:
103 domain = 'default' 104 msgdomain = domain.Default
104 if debug_level[domain] >= level: 105
106 if debug_level[msgdomain] >= level:
105 bb.event.fire(MsgDebug(msg), None) 107 bb.event.fire(MsgDebug(msg), None)
106 if not bb.event._ui_handlers: 108 if not bb.event._ui_handlers:
107 print 'DEBUG: ' + msg 109 print 'DEBUG: ' + msg
108 110
109def note(level, domain, msg, fn = None): 111def note(level, msgdomain, msg, fn = None):
110 if not domain: 112 if not msgdomain:
111 domain = 'default' 113 msgdomain = domain.Default
112 if level == 1 or verbose or debug_level[domain] >= 1: 114
115 if level == 1 or verbose or debug_level[msgdomain] >= 1:
113 bb.event.fire(MsgNote(msg), None) 116 bb.event.fire(MsgNote(msg), None)
114 if not bb.event._ui_handlers: 117 if not bb.event._ui_handlers:
115 print 'NOTE: ' + msg 118 print 'NOTE: ' + msg
116 119
117def warn(domain, msg, fn = None): 120def warn(msgdomain, msg, fn = None):
118 bb.event.fire(MsgWarn(msg), None) 121 bb.event.fire(MsgWarn(msg), None)
119 if not bb.event._ui_handlers: 122 if not bb.event._ui_handlers:
120 print 'WARNING: ' + msg 123 print 'WARNING: ' + msg
121 124
122def error(domain, msg, fn = None): 125def error(msgdomain, msg, fn = None):
123 bb.event.fire(MsgError(msg), None) 126 bb.event.fire(MsgError(msg), None)
124 if not bb.event._ui_handlers: 127 if not bb.event._ui_handlers:
125 print 'ERROR: ' + msg 128 print 'ERROR: ' + msg
126 129
127def fatal(domain, msg, fn = None): 130def fatal(msgdomain, msg, fn = None):
128 bb.event.fire(MsgFatal(msg), None) 131 bb.event.fire(MsgFatal(msg), None)
129 if not bb.event._ui_handlers: 132 if not bb.event._ui_handlers:
130 print 'FATAL: ' + msg 133 print 'FATAL: ' + msg