summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-24 12:41:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-25 18:14:53 +0100
commit6def374f134e1d1e46c7e21e0feb1d00ffe5d3e9 (patch)
treed2fb0df9b5f6cfdb769e82b6944da15a51e5c7ea /bitbake/lib
parent4c94d36022727fa5b640b73b3f2bc82a58443a33 (diff)
downloadpoky-6def374f134e1d1e46c7e21e0feb1d00ffe5d3e9.tar.gz
bitbake: cooker/cookerdata/main: Improve loglevel handling
Rather than passing debug/verbose/debug_domains around, pass the computed output of these. Ensure that the cooker sets the levels to match the levels currently set in the UI and generally try and make it easier to understand what the code is doing. (Bitbake rev: f0535beecc692a6213be2a22f9eef5956450ecf8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/cooker.py7
-rw-r--r--bitbake/lib/bb/cookerdata.py10
-rwxr-xr-xbitbake/lib/bb/main.py8
3 files changed, 16 insertions, 9 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 57caf38c2a..c34de303fb 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -446,7 +446,12 @@ class BBCooker:
446 logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o])) 446 logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o]))
447 print("Marking as dirty due to '%s' option change to '%s'" % (o, options[o])) 447 print("Marking as dirty due to '%s' option change to '%s'" % (o, options[o]))
448 clean = False 448 clean = False
449 setattr(self.configuration, o, options[o]) 449 if hasattr(self.configuration, o):
450 setattr(self.configuration, o, options[o])
451
452 bb.msg.loggerDefaultLogLevel = self.configuration.default_loglevel
453 bb.msg.loggerDefaultDomains = self.configuration.debug_domains
454
450 for k in bb.utils.approved_variables(): 455 for k in bb.utils.approved_variables():
451 if k in environment and k not in self.configuration.env: 456 if k in environment and k not in self.configuration.env:
452 logger.debug(1, "Updating new environment variable %s to %s" % (k, environment[k])) 457 logger.debug(1, "Updating new environment variable %s to %s" % (k, environment[k]))
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 6bf411bcd2..f43610e7f8 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -58,13 +58,15 @@ class ConfigParameters(object):
58 def updateToServer(self, server, environment): 58 def updateToServer(self, server, environment):
59 options = {} 59 options = {}
60 for o in ["abort", "force", "invalidate_stamp", 60 for o in ["abort", "force", "invalidate_stamp",
61 "debug", "dry_run", "dump_signatures", 61 "dry_run", "dump_signatures",
62 "debug_domains", "extra_assume_provided", "profile", 62 "extra_assume_provided", "profile",
63 "prefile", "postfile", "server_timeout"]: 63 "prefile", "postfile", "server_timeout"]:
64 options[o] = getattr(self.options, o) 64 options[o] = getattr(self.options, o)
65 65
66 options['build_verbose_shell'] = self.options.verbose 66 options['build_verbose_shell'] = self.options.verbose
67 options['build_verbose_stdout'] = self.options.verbose 67 options['build_verbose_stdout'] = self.options.verbose
68 options['default_loglevel'] = bb.msg.loggerDefaultLogLevel
69 options['debug_domains'] = bb.msg.loggerDefaultDomains
68 70
69 ret, error = server.runCommand(["updateConfig", options, environment, sys.argv]) 71 ret, error = server.runCommand(["updateConfig", options, environment, sys.argv])
70 if error: 72 if error:
@@ -114,11 +116,11 @@ class CookerConfiguration(object):
114 """ 116 """
115 117
116 def __init__(self): 118 def __init__(self):
117 self.debug_domains = [] 119 self.debug_domains = bb.msg.loggerDefaultDomains
120 self.default_loglevel = bb.msg.loggerDefaultLogLevel
118 self.extra_assume_provided = [] 121 self.extra_assume_provided = []
119 self.prefile = [] 122 self.prefile = []
120 self.postfile = [] 123 self.postfile = []
121 self.debug = 0
122 self.cmd = None 124 self.cmd = None
123 self.abort = True 125 self.abort = True
124 self.force = False 126 self.force = False
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index af2880f8d5..e483cce1ae 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -357,11 +357,11 @@ def bitbake_main(configParams, configuration):
357 357
358 if "BBDEBUG" in os.environ: 358 if "BBDEBUG" in os.environ:
359 level = int(os.environ["BBDEBUG"]) 359 level = int(os.environ["BBDEBUG"])
360 if level > configuration.debug: 360 if level > configParams.debug:
361 configuration.debug = level 361 configParams.debug = level
362 362
363 bb.msg.init_msgconfig(configParams.verbose, configuration.debug, 363 bb.msg.init_msgconfig(configParams.verbose, configParams.debug,
364 configuration.debug_domains) 364 configParams.debug_domains)
365 365
366 server_connection, ui_module = setup_bitbake(configParams, configuration) 366 server_connection, ui_module = setup_bitbake(configParams, configuration)
367 # No server connection 367 # No server connection