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

feat: add log level to environment variables sent to provider #1540

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Jan 11, 2025

Description

This adds a DEVPOD_LOG_LEVEL environment variable to the environment variables sent to the provider.

Design decisions

  • I chose this approach because it allows for further granular log levels in future.
  • I used the DEVPOD_ prefix because it seemed to be in that section of options.

Discussion

Any data received from the provider will be output at the info level because it's only doing a simple "send everything to info" rather than receiving any metadata to say the log level. My opinion would be to get this in today to allow debug logs to be output and then overhaul the log metadata as a future task.

Issue

Fixes #1537

How to test

In order to receive the log level in the provider, you should do something like this.

Now run the binary:

devpod up --debug <target>

This will then tell the provider to set to the log level to debug.

Copy link
Member

@pascalbreuninger pascalbreuninger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mrsimonemms
Copy link
Contributor Author

No problem @pascalbreuninger

I'm not 100% certain, but I don't think the failing test is any change I've made but looks like a Docker failure.

@pascalbreuninger pascalbreuninger merged commit d588d8b into loft-sh:main Jan 13, 2025
17 of 24 checks passed
@mrsimonemms
Copy link
Contributor Author

@pascalbreuninger I was just starting to go through the providers to add the DEVPOD_LOG_LEVEL envvars into each one and found DEVPOD_DEBUG in the Kubernetes provider

Having a look through, it looks like this actually a thing.

Question - do you want to keep both DEVPOD_DEBUG and DEVPOD_LOG_LEVEL? It doesn't feel a great idea to maintain two ways of doing the same thing.

Unless you think you'll change to having different log levels, I would suggest reverting this PR. Once you've done that, I'll update all the official providers to use DEVPOD_DEBUG (and my Hetzner provider). I'll also add a line to the provider docs too.

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

Successfully merging this pull request may close these issues.

DevPod should send the desired log level to providers
2 participants