mbox series

[0/1] Logging str() instead of repr() on exceptions

Message ID 20240809115013.17469-1-tdah@bang-olufsen.dk
Headers show
Series Logging str() instead of repr() on exceptions | expand

Message

Troels Dalsgaard Hoffmeyer Aug. 9, 2024, 11:50 a.m. UTC
I was trying to create a recipe for a go binary and was struggling a lot
in getting it working. One of the reasons for me struggling was some
poor error messages, i kept getting an error message with just
"FileNotFoundError(2, "file or directory not found")", with no
description of which file or directory. After some digging i found that
bitbake mostly logs repr(exception) instead of str(exception), and
repr() is usually used when you want a string representation that can be
interpreted as python again, whereas str() is for more human readable
strings.

Talking with RP on IRC, he mentioned that they might have encountered
situations in the past where repr() was providing more information that
str(), but wanted to see the specific case i was running into. This
patch only changes the specific log messages that i needed, but there is
an overall pattern of logging repr() instead of str()

Troels Dalsgaard Hoffmeyer (1):
  bb: Log str() instead of repr() for exceptions in build

 lib/bb/build.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)