Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional debugging verbosity #27

Open
btrautmann opened this issue Apr 13, 2023 · 0 comments
Open

Support additional debugging verbosity #27

btrautmann opened this issue Apr 13, 2023 · 0 comments

Comments

@btrautmann
Copy link
Contributor

btrautmann commented Apr 13, 2023

TLDR: We should support a way (possibly via a hook on the Charlatan object) to output additional logs on things like attempted matches and failed matches such that the end user doesn't need to add break-points to debug Charlatan or pull it locally. The default verbosity would remain, so this would be opt-in per Charlatan instance.

Sam's comment:

I feel ya on the struggle of making this readable for gql or other nuanced requests.

Two thoughts:

  1. We could probably do something to include the query string here in addition to just the path. That won't help for gql unless we make some tweaks to clients to include the operation name in the query string. Which would be really useful
  2. We could add a hook on Charlatan to allow you to customize how the request prints out for this debugging use case with a solid default. Then consumers can do whatever makes sense to them to make the failed match on the request easier to interpret. Like in the case of gql maybe you can parse the operation name from the body instead of using the whole body. Not sure of a great name for this. Maybe requestDebugFormatter? Naming this is hard haha

What do you think?

Originally posted by @samandmoore in #26 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant