nyaruka / gocommon

Common utility library for the TextIt platform.
Other
7 stars 11 forks source link

httpx.Trace should include errors in response? #39

Closed nicpottier closed 3 years ago

nicpottier commented 3 years ago

Looking to use Trace in swaggo and it is mostly great but there's a few things that feel like they are missing from a DRY perspective:

I guess it is balance between whether we think those two things would cause trouble elsewhere, but I certainly am finding myself wanting to use Trace as a way to say create an HTTPLog as a standalone thing and it isn't so convenient because of the above.

Thoughts @rowanseymour ?

rowanseymour commented 3 years ago

Whether it's right or wrong I can explain why it is the way it is. In the goflow/mailroom world we have httpx.Trace and flows.HTTPLog (see here). One is the low-level result of the request, the other is that tidied up into something for logging.

So I think I'd argue for keeping that separation of concerns, but maybe HTTPLog and the redaction stuff belongs in a httplog package in gocommon.

nicpottier commented 3 years ago

Ya, that's kind of where I've ended up and it's fine.