summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-12 23:24:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-15 09:33:10 +0100
commit6f624e399ebfa8661b5a39fd8178106c0d73b88e (patch)
tree7997a7e94b9e4e3d0bb7b809f231b7f5ecd9b5e1 /bin
parent0175fb834e3564eda226ac291fdd583671b463d1 (diff)
downloadbitbake-6f624e399ebfa8661b5a39fd8178106c0d73b88e.tar.gz
bitbake/logging: Overhaul internal logging process
At the moment it bugs me a lot that we only have one effective logging level for bitbake, despite the logging module having provision to do more advanced things. This patch: * Changes the core log level to the lowest level we have messages of (DEBUG-2) so messages always flow through the core logger * Allows build.py's task logging code to log all the output regardless of what output is on the console and sets this so log files now always contain debug level messages even if these don't appear on the console * Moves the verbose/debug/debug-domains code to be a UI side setting * Adds a filter to the UI to only print the user requested output. The result is more complete logfiles on disk but the usual output to the console. There are some behaviour changes intentionally made by this patch: a) the -v option now controls whether output is tee'd to the console. Ultimately, we likely want to output a message to the user about where the log file is and avoid placing output directly onto the console for every executing task. b) The functions get_debug_levels, the debug_levels variable, the set_debug_levels, the set_verbosity and set_debug_domains functions are removed from bb.msg. c) The "logging" init function changes format. d) All messages get fired to all handlers all the time leading to an increase in inter-process traffic. This could likely be hacked around short term with a function for a UI to only request events greater than level X. Longer term, having masks for event handlers would be better. e) logger.getEffectiveLevel() is no longer a reliable guide to what will/won't get logged so for now we look at the default log levels instead. [YOCTO #304] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bitbake3
-rwxr-xr-xbin/bitdoc5
2 files changed, 4 insertions, 4 deletions
diff --git a/bin/bitbake b/bin/bitbake
index fdeeb36a4..56f39f8ef 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -190,7 +190,7 @@ Default BBFILES are the .bb files in the current directory.""")
# server is daemonized this logfile will be truncated.
cooker_logfile = os.path.join(os.getcwd(), "cooker.log")
- bb.utils.init_logger(bb.msg, configuration.verbose, configuration.debug,
+ bb.msg.init_msgconfig(configuration.verbose, configuration.debug,
configuration.debug_domains)
# Ensure logging messages get sent to the UI as events
@@ -228,6 +228,7 @@ Default BBFILES are the .bb files in the current directory.""")
try:
return server.launchUI(ui_main, server_connection.connection, server_connection.events)
finally:
+ bb.event.ui_queue = []
server_connection.terminate()
return 1
diff --git a/bin/bitdoc b/bin/bitdoc
index 98fb025a5..08a0173d7 100755
--- a/bin/bitdoc
+++ b/bin/bitdoc
@@ -430,9 +430,8 @@ Create a set of html pages (documentation) for a bitbake.conf....
action = "store_true", dest = "verbose", default = False )
options, args = parser.parse_args( sys.argv )
-
- if options.debug:
- bb.msg.set_debug_level(options.debug)
+
+ bb.msg.init_msgconfig(options.verbose, options.debug)
return options.config, options.output