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

Usage of environment variable debug=True #87

Open
jensneuhaus opened this issue Dec 2, 2021 · 1 comment
Open

Usage of environment variable debug=True #87

jensneuhaus opened this issue Dec 2, 2021 · 1 comment

Comments

@jensneuhaus
Copy link

Problem: If one has debug=True set as environment variable, the logging behavior might be irritating using e.g. kubectl.

It brings a bunch of messages - e.g. when using the shell of an pod:

I1129 12:16:37.622982    5834 log.go:184] (0xc00010e160) (0xc0005ba1e0) Create stream
I1129 12:16:37.623601    5834 log.go:184] (0xc00010e160) (0xc0005ba1e0) Stream added, broadcasting: 1
I1129 12:16:37.716400    5834 log.go:184] (0xc00010e160) Reply frame received for 1
I1129 12:16:37.717023    5834 log.go:184] (0xc00010e160) (0xc0005ba280) Create stream
I1129 12:16:37.717043    5834 log.go:184] (0xc00010e160) (0xc0005ba280) Stream added, broadcasting: 3
I1129 12:16:37.770884    5834 log.go:184] (0xc00010e160) Reply frame received for 3
I1129 12:16:37.771082    5834 log.go:184] (0xc00010e160) (0xc000aac1e0) Create stream
I1129 12:16:37.771094    5834 log.go:184] (0xc00010e160) (0xc000aac1e0) Stream added, broadcasting: 5
I1129 12:16:37.823963    5834 log.go:184] (0xc00010e160) Reply frame received for 5
I1129 12:16:37.824279    5834 log.go:184] (0xc00010e160) (0xc00069b220) Create stream
I1129 12:16:37.824294    5834 log.go:184] (0xc00010e160) (0xc00069b220) Stream added, broadcasting: 7

Those messages appear with every key stroke when typing in the pod shell. This might be irritating to new k8s users and they might think, something is broken. I did some research on the problem - it seems like others have the same problem and a lot of questions are unanswered as its not obvious to make this link.

This was also posted in kubernetes/kubectl#1153 as I asked to change kubectl behavior.

Proposed solution: Would it be possible, to change the env variable used to something other then debug?

@smlx
Copy link

smlx commented Feb 3, 2022

It would be great if we could have an API option to toggle this behaviour rather than have it controlled via a global env var.

The current behaviour means that anything with transitive dependencies on this package spews cryptic debug messages to stderr if DEBUG is set in the environment, which is not very user-friendly.

smlx added a commit to uselagoon/lagoon-ssh-portal that referenced this issue Feb 3, 2022
smlx added a commit to uselagoon/lagoon-ssh-portal that referenced this issue Feb 3, 2022
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

No branches or pull requests

2 participants