Closed vytas7 closed 2 years ago
I think it would make sense to log the status and maybe a substring of the text, something like the first 50 / 100 chars? or maybe the first 25 - last 25?
Yeah, something like that. Maybe the response's Content-Type
too?
Hello, i would like to work on this issue.
From my understatement of this issue i just need to add a __repr__
function to falcon.testing.client.Result
class.
Should i just log the status code, a part of the text and the header content-type ?
Hi @RioAtHome! Sure, go ahead!
Yes, your understanding is correct -- you just need to add a __repr__
for the class in question (and add a test for it). Although it is a bit open ended -- feel free to tweak that representation to your liking or come up with your own suggestions.
Hello!. How about logging the status code, most important headers(Content-Type, Content-length, Authorization and Cookie) and parts of the text/content(as stated above, just log the beginning and end)?
Hi again!
Cookies are probably not the most common case for APIs, although it of course varies.
__repr__
should be reasonably short... So probably we cannot afford cramming in too much stuff, although it is tempting.
Implemented in https://github.com/falconry/falcon/pull/2046
At the time of this writing,
falcon.testing.Result
has no custom__repr__
:__repr__
is also picked up and shown by the popularpytest
.It could be nice to add a representation with a concise summary describing the most important attributes of the result (status code etc).