Closed apoorvapendse closed 2 days ago
Thank you for opening this PR! While I agree that it's useful to control the startup logs, I am not sure if a dedicated flag is the best approach. In https://github.com/tus/tusd/issues/1216#issuecomment-2500945079, I propose the idea of adding a generic flag for controlling the log level. If the log level does allow info messages, the startup logs would not be printed. Feel free to join the discussion in the other issue and let us know what you think.
This would also help us to remove the additional if
statements that are introduced in this PR. They are quite cumbersome and I worry that in the future we forget about them and add direct log statements that should actually go in such an if
statement. Using slog's method for logging at specific levels removes the need for these conditional clauses.
Thanks for the feedback. I'd like to collaborate with you to make the log level feature, if that's fine. Let me know how you are planning to approach it. I will read up on the documentation of slog in the meantime.
I've made the updations.
Thank you for the contribution! I did the final touches by myself to speed up the process of merging this.
Thanks a lot @Acconut!
This enables the user to enable or disable the startup logs while starting the tusd server. It helps the user suppress the startup logs as per their preference.
The flag has a default value of true. Fixes #1216.
Before:
After:
set as false:
set as true explicity:
default: