summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-09 23:38:35 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:48 +0000
commitaaa55880ac79f470e613130baefdf317a764cbf2 (patch)
tree9ce5da72131cd6087afad976f51ab73457d201e4 /bitbake/lib/bb/build.py
parent25e519a80fc453de1468823b2bf26ab053aa0dca (diff)
downloadopenembedded-core-aaa55880ac79f470e613130baefdf317a764cbf2.tar.gz
openembedded-core-aaa55880ac79f470e613130baefdf317a764cbf2.tar.bz2
openembedded-core-aaa55880ac79f470e613130baefdf317a764cbf2.zip
build: send logging messages to the log file for python functions
(Bitbake rev: ee1cce6ab21ddda60a7a070d03e98ff8485a5e71) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 5d07b06640..e4e767ebc1 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -29,12 +29,14 @@ import os
import sys
import logging
import bb
+import bb.msg
import bb.utils
import bb.process
from contextlib import nested
from bb import data, event, mkdirhier, utils
-logger = logging.getLogger("BitBake.Build")
+bblogger = logging.getLogger('BitBake')
+logger = logging.getLogger('BitBake.Build')
NULL = open('/dev/null', 'r')
@@ -164,7 +166,7 @@ def {function}(d):
{function}(d)
"""
-#logformatter = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+logformatter = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
def exec_func_python(func, d, runfile, logfile, cwd=None):
"""Execute a python BB 'function'"""
@@ -181,9 +183,9 @@ def exec_func_python(func, d, runfile, logfile, cwd=None):
if cwd:
os.chdir(cwd)
- #handler = logging.StreamHandler(logfile)
- #handler.setFormatter(logformatter)
- #bblogger.addHandler(handler)
+ handler = logging.StreamHandler(logfile)
+ handler.setFormatter(logformatter)
+ bblogger.addHandler(handler)
try:
comp = utils.better_compile(code, func, bbfile)
@@ -194,7 +196,7 @@ def exec_func_python(func, d, runfile, logfile, cwd=None):
raise FuncFailed(func, None)
finally:
- #bblogger.removeHandler(handler)
+ bblogger.removeHandler(handler)
if olddir:
os.chdir(olddir)