shuttle icon indicating copy to clipboard operation
shuttle copied to clipboard

[Feature]: Allow passing in an arg in the shuttle main macro for log level

Open unbekanntes-pferd opened this issue 2 years ago • 5 comments

Describe the feature

Description Currently a tracing subscriber is initialized for every service in the shuttle_runtime::main codegen, this set the log level by default to INFO unless there is one in the environment. The log level is set to DEBUG in the deployer environment though, so the tracing for a service will be set to DEBUG. We should allow the user to pass in an arg to change the log level, but it should only be possible to set it higher than or equal to DEBUG.

Requirements Implement the necessary changes in the codegen/shuttle_main macro to allow passing in an arg for log level. Refactor the tracing setup in the codegen to use the log level from the arg if it exists and is higher than or equal to debug.

Batch 2.0 task: https://www.notion.so/535743328783490baacd6fbb7befdd5d?v=f0988ae59d8f47e788bed373047a4255&p=724156276c0c4421abe614f40c75ab3b&pm=s

@XaviFP and @unbekanntes-pferd will look at this feature

Suggestion or Example of how the feature would be used

No response

Duplicate declaration

  • [X] I have searched the issues and this feature has not been requested before.

unbekanntes-pferd avatar May 02 '23 16:05 unbekanntes-pferd

Hey @XaviFP and @unbekanntes-pferd! We have another community member who has expressed interest in implementing this, so I just wanted to check in and see how this is going, and if you are still working on this or perhaps need some help?

oddgrd avatar May 31 '23 06:05 oddgrd

Hey @oddgrd - we have a proposal ready (@XaviFP recently added tests) - we'll open a PR by end of week latest. For doc purposes: https://github.com/unbekanntes-pferd/shuttle/tree/feature/842

unbekanntes-pferd avatar May 31 '23 06:05 unbekanntes-pferd

That's great!

oddgrd avatar May 31 '23 06:05 oddgrd

Nice!

derkbell avatar May 31 '23 10:05 derkbell

@oddgrd Is this still wanted or should it close due to #1003 ?

jonaro00 avatar Aug 17 '23 14:08 jonaro00

Closing this since custom tracing subscribers (or other loggers) are now supported. https://docs.shuttle.rs/configuration/logs

jonaro00 avatar Mar 27 '24 16:03 jonaro00