[bitbake-devel] [PATCH 2/3] bitbake-layers: fix logging
Paul Eggleton
paul.eggleton at linux.intel.com
Fri Feb 20 17:52:42 UTC 2015
Logging output was simply not getting printed.
Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
bin/bitbake-layers | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 2622bc0..fc62386 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -39,8 +39,18 @@ import bb.utils
import bb.tinfoil
-logger = logging.getLogger('BitBake')
-
+def logger_create(name, output=sys.stderr):
+ logger = logging.getLogger(name)
+ console = logging.StreamHandler(output)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if output.isatty():
+ format.enable_color()
+ console.setFormatter(format)
+ logger.addHandler(console)
+ logger.setLevel(logging.INFO)
+ return logger
+
+logger = logger_create('bitbake-layers')
class Commands():
--
1.9.3
More information about the bitbake-devel
mailing list