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

Christopher Larson clarson at kergoth.com
Sat Jul 9 18:30:38 UTC 2016


On Sat, Jul 9, 2016 at 10:10 AM, Brian Avery <avery.brian at gmail.com> wrote:

> If you mean something like:
>
>         logger.exception("Ed's message is this err = '%s'"
> %(err),exc_info=err)
>
> or
>
>         logger.exception("Ed's message is this err = '%s'"
> %(err),exc_info=err,stack_info=True) (if we want to see the exception
> stack search)
>
>
> Then, i'd agree your way is better/clearer.
>
That's the idea, but there are a couple issues with those examples.

exc_info doesn't accept the exception, it takes a boolean, and using
exception() with exc_info is redundant. 'exception(foo)' is just shorthand
for 'error(foo, exc_info=True)', and I think stack_info may also be
unnecessary, as exc_info implies traceback.print_exception(), which prints
exception traceback entries already.

But yes, that's the concept. I think this would be sufficient:

    logger.exception('An uncaught exception occurred in runqueue')

Of course we'd want to generate such an exception to test it.
-- 
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/20160709/a18a4d1f/attachment-0002.html>


More information about the bitbake-devel mailing list