diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-04-09 19:27:21 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:32 +0100 |
commit | 350c3126e130b1f6d22c6b5061a3feacc05025fc (patch) | |
tree | 690cf3ef9f1bf2271d0ddb7ee5d12fc5050d0999 /bitbake/lib/bb | |
parent | 943ece8610fce9e6e5fda1b524ee479f013e8c5b (diff) | |
download | openembedded-core-350c3126e130b1f6d22c6b5061a3feacc05025fc.tar.gz openembedded-core-350c3126e130b1f6d22c6b5061a3feacc05025fc.tar.bz2 openembedded-core-350c3126e130b1f6d22c6b5061a3feacc05025fc.zip |
Make the default domain a proper domain, not a string
This lets you do -l Default on the commandline to bump the debug level of
messages with no domain, without bumping the level of everything else.
(Bitbake rev: bef33dfc36713d8c93e38e63ddac2e4f9858e787)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/msg.py | 55 |
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): return Tuple(*range(len(fields))) domain = _NamedTuple("Domain",( - 'Build', - 'Cache', - 'Collection', - 'Data', - 'Depends', - 'Fetcher', - 'Parsing', - 'PersistData', - 'Provider', - 'RunQueue', - 'TaskData', - 'Util')) + "Default", + "Build", + "Cache", + "Collection", + "Data", + "Depends", + "Fetcher", + "Parsing", + "PersistData", + "Provider", + "RunQueue", + "TaskData", + "Util")) class MsgBase(bb.event.Event): @@ -80,13 +81,13 @@ class MsgPlain(MsgBase): def set_debug_level(level): for d in domain: debug_level[d] = level - debug_level['default'] = level + debug_level[domain.Default] = level def set_verbose(level): verbose = level -def set_debug_domains(domain_strings): - for domainstr in domain_strings: +def set_debug_domains(msgdomainstrings): + for domainstr in msgdomainstrings: for d in domain: if domain._fields[d] == domainstr: debug_level[d] += 1 @@ -98,33 +99,35 @@ def set_debug_domains(domain_strings): # Message handling functions # -def debug(level, domain, msg, fn = None): - if not domain: - domain = 'default' - if debug_level[domain] >= level: +def debug(level, msgdomain, msg, fn = None): + if not msgdomain: + msgdomain = domain.Default + + if debug_level[msgdomain] >= level: bb.event.fire(MsgDebug(msg), None) if not bb.event._ui_handlers: print 'DEBUG: ' + msg -def note(level, domain, msg, fn = None): - if not domain: - domain = 'default' - if level == 1 or verbose or debug_level[domain] >= 1: +def note(level, msgdomain, msg, fn = None): + if not msgdomain: + msgdomain = domain.Default + + if level == 1 or verbose or debug_level[msgdomain] >= 1: bb.event.fire(MsgNote(msg), None) if not bb.event._ui_handlers: print 'NOTE: ' + msg -def warn(domain, msg, fn = None): +def warn(msgdomain, msg, fn = None): bb.event.fire(MsgWarn(msg), None) if not bb.event._ui_handlers: print 'WARNING: ' + msg -def error(domain, msg, fn = None): +def error(msgdomain, msg, fn = None): bb.event.fire(MsgError(msg), None) if not bb.event._ui_handlers: print 'ERROR: ' + msg -def fatal(domain, msg, fn = None): +def fatal(msgdomain, msg, fn = None): bb.event.fire(MsgFatal(msg), None) if not bb.event._ui_handlers: print 'FATAL: ' + msg |