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

how to debug? #27

Closed
3 tasks
sibelius opened this issue Oct 16, 2020 · 5 comments · Fixed by #40
Closed
3 tasks

how to debug? #27

sibelius opened this issue Oct 16, 2020 · 5 comments · Fixed by #40
Labels
question Further information about the library is requested released Has been released and published

Comments

@sibelius
Copy link
Contributor

Can we have some logging? like koa logger? like this:

image

I think it would be cool to show:

  • show messages received
  • show messages sent
  • show GraphQL operation info? (operation name ?)
@n1ru4l
Copy link
Contributor

n1ru4l commented Oct 16, 2020

I also agree! Having a snippet in the README for getting started would be awesome! People can then adjust it to their own needs as they wish.

@enisdenjo enisdenjo added the question Further information about the library is requested label Oct 19, 2020
@enisdenjo
Copy link
Owner

enisdenjo commented Oct 19, 2020

Adding a good, versatile, logging system is not a straight forward task, you have to keep the following in mind:

  • Use console.log?
    • Not versatile. Can pollute the console with mixed logs. Not in sync with a potential custom logging system (which almost every GQL server offers). Has to be disabled/enabled.
  • Pass in a custom logger?
    • Have to "pollute" the lib by injecting the logger calls in various locations. Never-ending task - you have to rely on the lib itself to add support for the logs you want to add.

Having the reasoning above in mind, I'd like to avoid logging from within the lib. This lib is intended to be another tool in your tool-belt, meaning - you have to provide your own logging implementation on top of the lib. Please do argument your standpoint if you think my reasoning is off, I am indeed open for discussion.

Furthermore, not integrating a logger does not mean that you cannot extend the lib to log all the details you have requested! Please consult the "ws server usage with console logging" recipe.

@n1ru4l
Copy link
Contributor

n1ru4l commented Oct 19, 2020

@enisdenjo I guess your snippet would be a nice addition to the recipe section?

@enisdenjo
Copy link
Owner

Please re-open this issue (or open a new one) if you think that the server usage with console logging recipe in the readme is lacking or you want to discuss my statement on internal logging from the comment above.

@enisdenjo enisdenjo added released Has been released and published and removed released Has been released and published labels Oct 19, 2020
@enisdenjo
Copy link
Owner

🎉 This issue has been resolved in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@enisdenjo enisdenjo added the released Has been released and published label Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information about the library is requested released Has been released and published
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants