]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool / recipetool: ensure bb.note() gets printed
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 18 May 2015 15:15:04 +0000 (16:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 May 2015 07:16:47 +0000 (08:16 +0100)
Most of the time when bb.note() gets called we want to see the output,
so ensure the level is set appropriately depending on the command line
options instead of being fixed at warning. (We don't want to see the
notes for fetch/unpack/patch though as they are too verbose).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/__init__.py
scripts/lib/devtool/standard.py
scripts/recipetool

index 5a06c78b571c142c49dde97c89e37a40a679538d..9ec1ef6817a8d216bac514b29ce49ae2ad7571c0 100644 (file)
@@ -85,6 +85,6 @@ def setup_tinfoil():
     import bb.tinfoil
     tinfoil = bb.tinfoil.Tinfoil()
     tinfoil.prepare(False)
-    tinfoil.logger.setLevel(logging.WARNING)
+    tinfoil.logger.setLevel(logger.getEffectiveLevel())
     return tinfoil
 
index 61c0df9b1169f046a6b5cb79cf93416f7faa69ba..122121aedb3dc5876c2cdb26839b75e2bbba2f13 100644 (file)
@@ -245,6 +245,11 @@ def _extract_source(srctree, keep_temp, devbranch, d):
     bb.utils.mkdirhier(srctree)
     os.rmdir(srctree)
 
+    # We don't want notes to be printed, they are too verbose
+    origlevel = bb.logger.getEffectiveLevel()
+    if logger.getEffectiveLevel() > logging.DEBUG:
+        bb.logger.setLevel(logging.WARNING)
+
     initial_rev = None
     tempdir = tempfile.mkdtemp(prefix='devtool')
     try:
@@ -349,6 +354,8 @@ def _extract_source(srctree, keep_temp, devbranch, d):
         shutil.move(srcsubdir, srctree)
         logger.info('Source tree extracted to %s' % srctree)
     finally:
+        bb.logger.setLevel(origlevel)
+
         if keep_temp:
             logger.info('Preserving temporary directory %s' % tempdir)
         else:
index 2cfa76320182334e3a63a7c6c0d712e89be890ec..b7d3ee887c7f41c91222fab3c47ff8a18a77839f 100755 (executable)
@@ -40,7 +40,7 @@ def tinfoil_init():
     for plugin in plugins:
         if hasattr(plugin, 'tinfoil_init'):
             plugin.tinfoil_init(tinfoil)
-    tinfoil.logger.setLevel(logging.WARNING)
+    tinfoil.logger.setLevel(logger.getEffectiveLevel())
 
 def main():