[Feature]: Allow passing in an arg in the shuttle main macro for log level
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.
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?
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
That's great!
Nice!
@oddgrd Is this still wanted or should it close due to #1003 ?
Closing this since custom tracing subscribers (or other loggers) are now supported. https://docs.shuttle.rs/configuration/logs