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

Brian Avery avery.brian at gmail.com
Sat Jul 9 17:10:42 UTC 2016


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.

-b

an intel employee

On Fri, Jul 8, 2016 at 9:03 PM, Christopher Larson <clarson at kergoth.com>
wrote:

>
> 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/20160709/86d8383c/attachment-0002.html>


More information about the bitbake-devel mailing list