Giter VIP home page Giter VIP logo

Comments (5)

enisdenjo avatar enisdenjo commented on May 22, 2024 3

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.

from graphql-ws.

n1ru4l avatar n1ru4l commented on May 22, 2024 1

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

from graphql-ws.

enisdenjo avatar enisdenjo commented on May 22, 2024 1

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.

from graphql-ws.

n1ru4l avatar n1ru4l commented on May 22, 2024

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.

from graphql-ws.

enisdenjo avatar enisdenjo commented on May 22, 2024

🎉 This issue has been resolved in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from graphql-ws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.