]> code.ossystems Code Review - openembedded-core.git/commitdiff
build: use logger.isEnabledFor, not getEffectiveLevel
authorChris Larson <chris_larson@mentor.com>
Wed, 5 Jan 2011 18:19:21 +0000 (11:19 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Jan 2011 10:46:54 +0000 (10:46 +0000)
I think this is less confusing, and avoids needing to know about the *range*
of logging levels, instead simply asking what we really want to know.

(Bitbake rev: dc2264387617586b5c0a61e126c75edde5e7abcd)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/build.py

index 96e4e2f077e388dc1c3385faaf6a0bdf05abc64e..2d8fe8be84e172a6beffd2e1adce360e7219d4c9 100644 (file)
@@ -216,7 +216,7 @@ def exec_func_shell(function, d, runfile, cwd=None):
 
     with open(runfile, 'w') as script:
         script.write('#!/bin/sh -e\n')
-        if logger.getEffectiveLevel() <= logging.DEBUG:
+        if logger.isEnabledFor(logging.DEBUG):
             script.write("set -x\n")
         data.emit_func(function, script, d)
 
@@ -230,7 +230,7 @@ def exec_func_shell(function, d, runfile, cwd=None):
 
     cmd = runfile
 
-    if logger.getEffectiveLevel() <= logging.DEBUG:
+    if logger.isEnabledFor(logging.DEBUG):
         logfile = LogTee(logger, sys.stdout)
     else:
         logfile = sys.stdout