summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/__init__.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-03-09 11:33:39 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-13 11:29:23 +0000
commit26473bfbeaed905e72ca95cf69d7bef3422814ac (patch)
tree2023c98e0fa9378988ce5552052014faea1658ef /bitbake/lib/bb/__init__.py
parent954b5258f182c71f9df2862d2771b5bdc82099e2 (diff)
downloadpoky-26473bfbeaed905e72ca95cf69d7bef3422814ac.tar.gz
bitbake: 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") (Bitbake rev: f32a8bc7ff7a0b0750b6934a96f5d48391b1383a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/__init__.py')
-rw-r--r--bitbake/lib/bb/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index 88641e280b..acd4af13a8 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -43,12 +43,13 @@ class BBLogger(Logger):
43 Logger.__init__(self, name) 43 Logger.__init__(self, name)
44 44
45 def bbdebug(self, level, msg, *args, **kwargs): 45 def bbdebug(self, level, msg, *args, **kwargs):
46 loglevel = logging.DEBUG - level + 1
46 if not bb.event.worker_pid: 47 if not bb.event.worker_pid:
47 if self.name in bb.msg.loggerDefaultDomains and level > (bb.msg.loggerDefaultDomains[self.name]): 48 if self.name in bb.msg.loggerDefaultDomains and loglevel > (bb.msg.loggerDefaultDomains[self.name]):
48 return 49 return
49 if level > (bb.msg.loggerDefaultDebugLevel): 50 if level > (bb.msg.loggerDefaultDebugLevel):
50 return 51 return
51 return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs) 52 return self.log(loglevel, msg, *args, **kwargs)
52 53
53 def plain(self, msg, *args, **kwargs): 54 def plain(self, msg, *args, **kwargs):
54 return self.log(logging.INFO + 1, msg, *args, **kwargs) 55 return self.log(logging.INFO + 1, msg, *args, **kwargs)