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

The line is logging (almost) every request to stderr #4

Closed
justinmchase opened this issue Jul 15, 2021 · 4 comments
Closed

The line is logging (almost) every request to stderr #4

justinmchase opened this issue Jul 15, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@justinmchase
Copy link

https://github.com/cloudydeno/deno-kubernetes_client/blob/main/transports/via-kubeconfig.ts#L102

I am finding it useful at the moment as I'm debugging but I kind of wish it was optionally logged. I'm not sure how deno logging is supposed to work yet but something like the old debug library to enable trace logging in submodules if desired would be nice.

@justinmchase justinmchase changed the title The line is logging (almost) every request to stdout The line is logging (almost) every request to stderr Jul 15, 2021
@danopia
Copy link
Member

danopia commented Jul 16, 2021

Fair point here. The KubectlRawRestClient only does its logging when --verbose is passed, which works but isn't the best criteria: https://github.com/cloudydeno/deno-kubernetes_client/blob/main/transports/via-kubectl-raw.ts#L10 I just haven't had the need to do similar logic in KubeConfigRestClient because I don't use it interactively, and I've been appreciating the logs when deployed into a cluster ;)

If the --verbose flag works for you then that makes sense to copy over to the other file to increase parity.

Deno's runtime doesn't have any real opinions on logging... it's up to the module to use a proper logging module if it wants one.

@justinmchase
Copy link
Author

Deno does have a log library in the std library:
https://deno.land/std@0.101.0/log

I haven't looked into it in depth yet but I'm wondering if it will help here.

@danopia danopia added the enhancement New feature or request label Jul 17, 2021
@danopia
Copy link
Member

danopia commented Jul 18, 2021

/std/log can help with managing log levels, but it still needs to be configured by the application - it doesn't handle letting the user change the log level, for example. There's a hardcoded default level/config and if you want for example a --verbose flag it's up to you to wire it.

So I don't see value in adding the library just for this; I'll just copy the --verbose flag over. More flexible logging would be a different ticket

@justinmchase
Copy link
Author

I see. They should probably add log categorization and enable / disablement of categories to that api, to replace debug.

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

No branches or pull requests

2 participants