[bitbake-devel] hob: format error messages properly

Submitted by Paul Eggleton on Sept. 11, 2012, 11 a.m.

Details

Message ID 1347361205-9711-1-git-send-email-paul.eggleton@linux.intel.com
State Accepted, archived
Headers show

Commit Message

Paul Eggleton Sept. 11, 2012, 11 a.m.
Error messages that use arguments need to be formatted properly, or we
don't get the full message. Use a formatter to do this when an error
occurs.

Partial fix for [YOCTO #2983].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index dac2f74..35cbded 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -177,7 +177,9 @@  class HobHandler(gobject.GObject):
 
         elif isinstance(event, logging.LogRecord):
             if event.levelno >= logging.ERROR:
-                self.error_msg += event.msg + '\n'
+                formatter = bb.msg.BBLogFormatter()
+                formatter.format(event)
+                self.error_msg += event.message + '\n'
 
         elif isinstance(event, bb.event.TargetsTreeGenerated):
             self.current_phase = "data generation"

Comments

Richard Purdie Sept. 14, 2012, 8:27 a.m.
On Tue, 2012-09-11 at 12:00 +0100, Paul Eggleton wrote:
> Error messages that use arguments need to be formatted properly, or we
> don't get the full message. Use a formatter to do this when an error
> occurs.
> 
> Partial fix for [YOCTO #2983].
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Merged to master, thanks.

Richard