diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2020-03-09 11:33:39 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-12 23:01:34 +0000 |
commit | f32a8bc7ff7a0b0750b6934a96f5d48391b1383a (patch) | |
tree | 58104e046a6dfd28d456248f8dc9217260242577 /lib/bb/__init__.py | |
parent | 2e26e97129d4c54bf86cdea8f9791696a06a36b4 (diff) | |
download | bitbake-f32a8bc7ff7a0b0750b6934a96f5d48391b1383a.tar.gz |
lib/bb/msg: Convert default domains to a dictionary
Converts the default domain variable to a dictionary where the keys are
the logging domains and the values are the logging level (instead of the
debug count). This makes it easier to deal with the logging domains and
the awkward conversion from a list to a dictionary only needs to be done
once when logging is initialized. Finally, other code has been written
that already assumes this variable is a dictionary, see:
f04cd93109 ("bitbake: lib/bb: Optimise out debug messages from cooker")
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/__init__.py')
-rw-r--r-- | lib/bb/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py index 88641e280..acd4af13a 100644 --- a/lib/bb/__init__.py +++ b/lib/bb/__init__.py @@ -43,12 +43,13 @@ class BBLogger(Logger): Logger.__init__(self, name) def bbdebug(self, level, msg, *args, **kwargs): + loglevel = logging.DEBUG - level + 1 if not bb.event.worker_pid: - if self.name in bb.msg.loggerDefaultDomains and level > (bb.msg.loggerDefaultDomains[self.name]): + if self.name in bb.msg.loggerDefaultDomains and loglevel > (bb.msg.loggerDefaultDomains[self.name]): return if level > (bb.msg.loggerDefaultDebugLevel): return - return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs) + return self.log(loglevel, msg, *args, **kwargs) def plain(self, msg, *args, **kwargs): return self.log(logging.INFO + 1, msg, *args, **kwargs) |