diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-24 12:28:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-25 18:14:53 +0100 |
commit | 4c94d36022727fa5b640b73b3f2bc82a58443a33 (patch) | |
tree | 58e5367bdc2a8c1dbf89789705d6f7b7aced0831 | |
parent | b221b8a657888be605f6c31e6353b10b08a619e6 (diff) | |
download | poky-4c94d36022727fa5b640b73b3f2bc82a58443a33.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: 423c046f2173aaff3072dc3d0882d01b8a0b0212)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 97cc0fd60f..9334f11fb8 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 94f9cb371c..974d2ff065 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -29,6 +29,9 @@ from bb import data, event, utils | |||
29 | bblogger = logging.getLogger('BitBake') | 29 | bblogger = logging.getLogger('BitBake') |
30 | logger = logging.getLogger('BitBake.Build') | 30 | logger = logging.getLogger('BitBake.Build') |
31 | 31 | ||
32 | verboseShellLogging = False | ||
33 | verboseStdoutLogging = False | ||
34 | |||
32 | __mtime_cache = {} | 35 | __mtime_cache = {} |
33 | 36 | ||
34 | def cached_mtime_noerror(f): | 37 | def cached_mtime_noerror(f): |
@@ -413,7 +416,7 @@ def exec_func_shell(func, d, runfile, cwd=None): | |||
413 | 416 | ||
414 | bb.data.emit_func(func, script, d) | 417 | bb.data.emit_func(func, script, d) |
415 | 418 | ||
416 | if bb.msg.loggerVerboseLogs: | 419 | if verboseShellLogging or bb.utils.to_boolean(d.getVar("BB_VERBOSE_LOGS", False)): |
417 | script.write("set -x\n") | 420 | script.write("set -x\n") |
418 | if cwd: | 421 | if cwd: |
419 | script.write("cd '%s'\n" % cwd) | 422 | script.write("cd '%s'\n" % cwd) |
@@ -433,7 +436,7 @@ exit $ret | |||
433 | if fakerootcmd: | 436 | if fakerootcmd: |
434 | cmd = [fakerootcmd, runfile] | 437 | cmd = [fakerootcmd, runfile] |
435 | 438 | ||
436 | if bb.msg.loggerDefaultVerbose: | 439 | if verboseStdoutLogging: |
437 | logfile = LogTee(logger, StdoutNoopContextManager()) | 440 | logfile = LogTee(logger, StdoutNoopContextManager()) |
438 | else: | 441 | else: |
439 | logfile = StdoutNoopContextManager() | 442 | logfile = StdoutNoopContextManager() |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 33452e7b93..57caf38c2a 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -413,11 +413,6 @@ class BBCooker: | |||
413 | self.data.disableTracking() | 413 | self.data.disableTracking() |
414 | 414 | ||
415 | def parseConfiguration(self): | 415 | def parseConfiguration(self): |
416 | # Set log file verbosity | ||
417 | verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", False)) | ||
418 | if verboselogs: | ||
419 | bb.msg.loggerVerboseLogs = True | ||
420 | |||
421 | # Change nice level if we're asked to | 416 | # Change nice level if we're asked to |
422 | nice = self.data.getVar("BB_NICE_LEVEL") | 417 | nice = self.data.getVar("BB_NICE_LEVEL") |
423 | if nice: | 418 | if nice: |
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index b86e7d446b..6bf411bcd2 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 02a261e30c..6370ce50a1 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1263,8 +1263,8 @@ class RunQueue: | |||
1263 | "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv, | 1263 | "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv, |
1264 | "sigdata" : bb.parse.siggen.get_taskdata(), | 1264 | "sigdata" : bb.parse.siggen.get_taskdata(), |
1265 | "logdefaultlevel" : bb.msg.loggerDefaultLogLevel, | 1265 | "logdefaultlevel" : bb.msg.loggerDefaultLogLevel, |
1266 | "logdefaultverbose" : bb.msg.loggerDefaultVerbose, | 1266 | "build_verbose_shell" : self.cooker.configuration.build_verbose_shell, |
1267 | "logdefaultverboselogs" : bb.msg.loggerVerboseLogs, | 1267 | "build_verbose_stdout" : self.cooker.configuration.build_verbose_stdout, |
1268 | "logdefaultdomain" : bb.msg.loggerDefaultDomains, | 1268 | "logdefaultdomain" : bb.msg.loggerDefaultDomains, |
1269 | "prhost" : self.cooker.prhost, | 1269 | "prhost" : self.cooker.prhost, |
1270 | "buildname" : self.cfgData.getVar("BUILDNAME"), | 1270 | "buildname" : self.cfgData.getVar("BUILDNAME"), |