[bitbake-devel] [PATCH 1/7] runqueue: improve exception logging

Christopher Larson clarson at kergoth.com
Sat Jul 9 04:03:32 UTC 2016


On Fri, Jul 8, 2016 at 5:52 PM, brian avery <avery.brian at gmail.com> wrote:

> From: Ed Bartosh <ed.bartosh at linux.intel.com>
>
> Runqueue errors direct the user to view the "failure below",
> but no additional error message is available.
>
> Log the stacktrace so that the user can see what went wrong.
>
> Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
> Signed-off-by: brian avery <brian.avery at intel.com>
> ---
>  lib/bb/runqueue.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
> index 57be15a..04f2f4c 100644
> --- a/lib/bb/runqueue.py
> +++ b/lib/bb/runqueue.py
> @@ -1219,8 +1219,10 @@ class RunQueue:
>                  pass
>              self.state = runQueueComplete
>              raise
> -        except:
> -            logger.error("An uncaught exception occured in runqueue,
> please see the failure below:")
> +        except Exception as err:
> +            import traceback
> +            logger.error("An uncaught exception occured in runqueue:
> '%s'" % err)
> +            logger.error(traceback.format_exc())
>

Is there a reason we aren't just passing the exception in and letting the
logging format it and pass it through to the UI for formatting? See
logger.exception() and the exc_info= keyword argument for error().
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160708/08216d0d/attachment-0002.html>


More information about the bitbake-devel mailing list