Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global --debug flag to enable debug logs (ala LOG_LEVEL=debug) #583

Open
michaeldwan opened this issue Oct 28, 2021 · 5 comments
Open

Comments

@michaeldwan
Copy link
Member

The debug logs are useful for diagnosing issues with the api, builds, remote builders, wireguard, etc. Unfortunately an env variable isn't discoverable so nobody knows about them. We should enable them from a common global flag that people already expect to help with debugging, like --debug, --verbose, --trace, etc.

We might also want to print a message on error instructing the user to try again with that flag.

Hopefully exposing debug logs will help folks figure out issues before heading to the forum or giving up.

me-diru added a commit to me-diru/flyctl that referenced this issue Mar 28, 2022
- part of superfly#583
- added debug global flag to see debug logs of commands in terminal

Signed-off-by: Rohit Dandamudi <rohitdandamudi.1100@gmail.com>
@me-diru
Copy link
Contributor

me-diru commented Mar 30, 2022

Hey!

I tried to implement this, it was easier to add the global flag and bind it to viper. I am not sure how to access the flag value at places where LOG_LEVEL=debug env is accessed(i.e inside the /internal package and the /terminal package init) 😅

I think there's a mix of old and new commands and how flags are associated with the context/cmdcontext, not sure the way I approached in the draft PR is the right noe, any pointers to go in the right direction are highly appreciated! thanks

@billyb2
Copy link
Member

billyb2 commented Aug 17, 2023

#2704 helps with this

@michaeldwan
Copy link
Member Author

@billyb2 does that PR achieve the same thing as LOG_LEVEL=debug? Or just sets that env variable?

@andrewbaxter
Copy link

It looks like there's already debug level logging via FLYCTL_OUTPUT_HAR here: #2289 (undocumented)

@andrewbaxter
Copy link

But #3107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants