diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-24 12:28:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-02 09:55:51 +0100 |
commit | 28f080629b5151ffaedc6ea493063eb8480c3664 (patch) | |
tree | 034566476b18cb46212f175e6976bdcf72fa53ea /bitbake | |
parent | 75c8a5f5666481854232778f046cb30473ea6dc9 (diff) | |
download | poky-28f080629b5151ffaedc6ea493063eb8480c3664.tar.gz |
bitbake: build/msg: Cleanup verbose option handling
The levels of indirection to set these verbose logging options is rather
crazy. This attempts to turn things into two specific options with
much more specific meanings. For now its all still controlled by the
commandline verbose option and should funciton as previously, with
the addition that the BB_VERBOSE_LOGS option can now be task specific.
(Bitbake rev: b4117231bf070703b9375af4411bcd160e07fdae)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 423c046f2173aaff3072dc3d0882d01b8a0b0212)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/bin/bitbake-worker | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/build.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 5 | ||||
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/msg.py | 6 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 4 |
6 files changed, 15 insertions, 18 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 9ef0d5a683..e3ce01eec8 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -413,9 +413,9 @@ class BitbakeWorker(object): | |||
413 | 413 | ||
414 | def handle_workerdata(self, data): | 414 | def handle_workerdata(self, data): |
415 | self.workerdata = pickle.loads(data) | 415 | self.workerdata = pickle.loads(data) |
416 | bb.build.verboseShellLogging = self.workerdata["build_verbose_shell"] | ||
417 | bb.build.verboseStdoutLogging = self.workerdata["build_verbose_stdout"] | ||
416 | bb.msg.loggerDefaultLogLevel = self.workerdata["logdefaultlevel"] | 418 | bb.msg.loggerDefaultLogLevel = self.workerdata["logdefaultlevel"] |
417 | bb.msg.loggerDefaultVerbose = self.workerdata["logdefaultverbose"] | ||
418 | bb.msg.loggerVerboseLogs = self.workerdata["logdefaultverboselogs"] | ||
419 | bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"] | 419 | bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"] |
420 | for mc in self.databuilder.mcdata: | 420 | for mc in self.databuilder.mcdata: |
421 | self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"]) | 421 | self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"]) |
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 17c70d0a61..aaada8a18b 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -27,6 +27,9 @@ from bb import data, event, utils | |||
27 | bblogger = logging.getLogger('BitBake') | 27 | bblogger = logging.getLogger('BitBake') |
28 | logger = logging.getLogger('BitBake.Build') | 28 | logger = logging.getLogger('BitBake.Build') |
29 | 29 | ||
30 | verboseShellLogging = False | ||
31 | verboseStdoutLogging = False | ||
32 | |||
30 | __mtime_cache = {} | 33 | __mtime_cache = {} |
31 | 34 | ||
32 | def cached_mtime_noerror(f): | 35 | def cached_mtime_noerror(f): |
@@ -371,7 +374,7 @@ def exec_func_shell(func, d, runfile, cwd=None): | |||
371 | 374 | ||
372 | bb.data.emit_func(func, script, d) | 375 | bb.data.emit_func(func, script, d) |
373 | 376 | ||
374 | if bb.msg.loggerVerboseLogs: | 377 | if verboseShellLogging or bb.utils.to_boolean(d.getVar("BB_VERBOSE_LOGS", False)): |
375 | script.write("set -x\n") | 378 | script.write("set -x\n") |
376 | if cwd: | 379 | if cwd: |
377 | script.write("cd '%s'\n" % cwd) | 380 | script.write("cd '%s'\n" % cwd) |
@@ -391,7 +394,7 @@ exit $ret | |||
391 | if fakerootcmd: | 394 | if fakerootcmd: |
392 | cmd = [fakerootcmd, runfile] | 395 | cmd = [fakerootcmd, runfile] |
393 | 396 | ||
394 | if bb.msg.loggerDefaultVerbose: | 397 | if verboseStdoutLogging: |
395 | logfile = LogTee(logger, StdoutNoopContextManager()) | 398 | logfile = LogTee(logger, StdoutNoopContextManager()) |
396 | else: | 399 | else: |
397 | logfile = StdoutNoopContextManager() | 400 | logfile = StdoutNoopContextManager() |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 730cdc56ff..000faf82f5 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -411,11 +411,6 @@ class BBCooker: | |||
411 | self.data.disableTracking() | 411 | self.data.disableTracking() |
412 | 412 | ||
413 | def parseConfiguration(self): | 413 | def parseConfiguration(self): |
414 | # Set log file verbosity | ||
415 | verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", False)) | ||
416 | if verboselogs: | ||
417 | bb.msg.loggerVerboseLogs = True | ||
418 | |||
419 | # Change nice level if we're asked to | 414 | # Change nice level if we're asked to |
420 | nice = self.data.getVar("BB_NICE_LEVEL") | 415 | nice = self.data.getVar("BB_NICE_LEVEL") |
421 | if nice: | 416 | if nice: |
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 32a8798f1e..30727bf2ee 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -58,11 +58,14 @@ 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 | "verbose", "debug", "dry_run", "dump_signatures", | 61 | "debug", "dry_run", "dump_signatures", |
62 | "debug_domains", "extra_assume_provided", "profile", | 62 | "debug_domains", "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 | ||
67 | options['build_verbose_stdout'] = self.options.verbose | ||
68 | |||
66 | ret, error = server.runCommand(["updateConfig", options, environment, sys.argv]) | 69 | ret, error = server.runCommand(["updateConfig", options, environment, sys.argv]) |
67 | if error: | 70 | if error: |
68 | raise Exception("Unable to update the server configuration with local parameters: %s" % error) | 71 | raise Exception("Unable to update the server configuration with local parameters: %s" % error) |
@@ -125,6 +128,8 @@ class CookerConfiguration(object): | |||
125 | self.skipsetscene = False | 128 | self.skipsetscene = False |
126 | self.invalidate_stamp = False | 129 | self.invalidate_stamp = False |
127 | self.dump_signatures = [] | 130 | self.dump_signatures = [] |
131 | self.build_verbose_shell = False | ||
132 | self.build_verbose_stdout = False | ||
128 | self.dry_run = False | 133 | self.dry_run = False |
129 | self.tracking = False | 134 | self.tracking = False |
130 | self.xmlrpcinterface = [] | 135 | self.xmlrpcinterface = [] |
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 2d88c4e72d..1b1a23bb50 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py | |||
@@ -146,18 +146,12 @@ class LogFilterLTLevel(logging.Filter): | |||
146 | # | 146 | # |
147 | 147 | ||
148 | loggerDefaultLogLevel = BBLogFormatter.NOTE | 148 | loggerDefaultLogLevel = BBLogFormatter.NOTE |
149 | loggerDefaultVerbose = False | ||
150 | loggerVerboseLogs = False | ||
151 | loggerDefaultDomains = {} | 149 | loggerDefaultDomains = {} |
152 | 150 | ||
153 | def init_msgconfig(verbose, debug, debug_domains=None): | 151 | def init_msgconfig(verbose, debug, debug_domains=None): |
154 | """ | 152 | """ |
155 | Set default verbosity and debug levels config the logger | 153 | Set default verbosity and debug levels config the logger |
156 | """ | 154 | """ |
157 | bb.msg.loggerDefaultVerbose = verbose | ||
158 | if verbose: | ||
159 | bb.msg.loggerVerboseLogs = True | ||
160 | |||
161 | if debug: | 155 | if debug: |
162 | bb.msg.loggerDefaultLogLevel = BBLogFormatter.DEBUG - debug + 1 | 156 | bb.msg.loggerDefaultLogLevel = BBLogFormatter.DEBUG - debug + 1 |
163 | elif verbose: | 157 | elif verbose: |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 2d35d478a4..a513b0983b 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1256,8 +1256,8 @@ class RunQueue: | |||
1256 | "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv, | 1256 | "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv, |
1257 | "sigdata" : bb.parse.siggen.get_taskdata(), | 1257 | "sigdata" : bb.parse.siggen.get_taskdata(), |
1258 | "logdefaultlevel" : bb.msg.loggerDefaultLogLevel, | 1258 | "logdefaultlevel" : bb.msg.loggerDefaultLogLevel, |
1259 | "logdefaultverbose" : bb.msg.loggerDefaultVerbose, | 1259 | "build_verbose_shell" : self.cooker.configuration.build_verbose_shell, |
1260 | "logdefaultverboselogs" : bb.msg.loggerVerboseLogs, | 1260 | "build_verbose_stdout" : self.cooker.configuration.build_verbose_stdout, |
1261 | "logdefaultdomain" : bb.msg.loggerDefaultDomains, | 1261 | "logdefaultdomain" : bb.msg.loggerDefaultDomains, |
1262 | "prhost" : self.cooker.prhost, | 1262 | "prhost" : self.cooker.prhost, |
1263 | "buildname" : self.cfgData.getVar("BUILDNAME"), | 1263 | "buildname" : self.cfgData.getVar("BUILDNAME"), |