emmett-framework / granian

A Rust HTTP server for Python applications
BSD 3-Clause "New" or "Revised" License
2.86k stars 83 forks source link

Flag to disable the logging #101

Closed Aeron closed 1 year ago

Aeron commented 1 year ago

Hey, the superb library you created here. I appreciate the effort very much.

Yet I am curious if there is a way to remove Granian logging, in case I like to control logging myself on the application level.

The only way I was quick to think of is to trick the log_dictconfig by supplying the {"root": {}} dictionary. (Yes, I am another guy who loves to run Granian programmatically, not by CLI.)

Will it be simpler to provide a separate CLI flag and a constructor argument for that?

gi0baro commented 1 year ago

Hi @Aeron, sorry for the late reply, I was AFK.

As of today there's no quick way to do so. Probably an additional flag for this would be the best option. You might want to open a PR for this?

Aeron commented 1 year ago

If you’re okay with the proposal, then sure, I’ll gladly look into it when I have a moment 👍

gi0baro commented 1 year ago

If you’re okay with the proposal, then sure, I’ll gladly look into it when I have a moment 👍

Sure thing! ❤️