Patchwork [bitbake-devel,1/1] bitbake: implement BB_VERBOSE_LOGS

login
register
mail settings
Submitter Paul Eggleton
Date Feb. 28, 2012, 1:37 p.m.
Message ID <476f2f92fd747eb947a71f3bf6100909c645b567.1330435914.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/22315/
State New
Headers show

Comments

Paul Eggleton - Feb. 28, 2012, 1:37 p.m.
Enable configuring whether "set +x" is added to all shell tasks rather
than forcing it; this is enabled by setting BB_VERBOSE_LOGS to 1.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/build.py  |    3 ++-
 bitbake/lib/bb/cooker.py |    4 ++++
 bitbake/lib/bb/msg.py    |    3 +++
 3 files changed, 9 insertions(+), 1 deletions(-)

Patch

diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index e85d7c4..d9079b2 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -223,7 +223,8 @@  def exec_func_shell(function, d, runfile, cwd=None):
         script.write('#!/bin/sh -e\n')
         data.emit_func(function, script, d)
 
-        script.write("set -x\n")
+        if bb.msg.loggerVerboseLogs:
+            script.write("set -x\n")
         if cwd:
             script.write("cd %s\n" % cwd)
         script.write("%s\n" % function)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 12b526b..d3bdd17 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -206,6 +206,10 @@  class BBCooker:
 
     def parseConfiguration(self):
 
+        # Set log file verbosity
+        verboselogs = bb.utils.to_boolean(self.configuration.data.getVar("BB_VERBOSE_LOGS", "0"))
+        if verboselogs:
+            bb.msg.loggerVerboseLogs = True
 
         # Change nice level if we're asked to
         nice = self.configuration.data.getVar("BB_NICE_LEVEL", True)
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 20d9bdd..9b39325 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -100,6 +100,7 @@  class BBLogFilter(object):
 
 loggerDefaultDebugLevel = 0
 loggerDefaultVerbose = False
+loggerVerboseLogs = False
 loggerDefaultDomains = []
 
 def init_msgconfig(verbose, debug, debug_domains = []):
@@ -108,6 +109,8 @@  def init_msgconfig(verbose, debug, debug_domains = []):
     """
     bb.msg.loggerDefaultDebugLevel = debug
     bb.msg.loggerDefaultVerbose = verbose
+    if verbose:
+        bb.msg.loggerVerboseLogs = True
     bb.msg.loggerDefaultDomains = debug_domains
 
 def addDefaultlogFilter(handler):