andreas / ocaml-graphql-server

GraphQL servers in OCaml
MIT License
624 stars 60 forks source link

Add logging to the example #172

Closed naartjie closed 4 years ago

naartjie commented 4 years ago

This PR adds logging to ./examples/server.exe and outputs a where the server URL:

listening on http://localhost:8080/graphql

Hoping this makes it more intuitive for onboarding newcomers.

andreas commented 4 years ago

This is a nice improvement for newcomers. I'm wondering whether simply printing the suggested line to stdout would suffice rather than introduce logs as a dependency. Did you have something particular in mind when choosing to use logs?

naartjie commented 4 years ago

Oh, I used logs mainly because it was already in examples/server.ml but I don't think they were turned on anyways - I don't think anything would get printed on an error the way it was.

I've replaced both the uses of logs: mine, and what was already there.

andreas commented 4 years ago

thanks!