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 set log level function #347

Closed
elegantm opened this issue Aug 18, 2022 · 4 comments
Closed

add set log level function #347

elegantm opened this issue Aug 18, 2022 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@elegantm
Copy link

elegantm commented Aug 18, 2022

/kind feature
log level output

set log level must be useful when debug a online program

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

zap:

https://pkg.go.dev/go.uber.org/zap#example-AtomicLevel-Config
cfg.Level.SetLevel(zap.ErrorLevel)

logrus

https://github.com/sirupsen/logrus
log.SetLevel(log.WarnLevel)

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
without set level ,i use flag package to set log level. like below
`

               //logger *logr.Logger
                _ = flag.Set("v", "0")

		fmt.Println("set debug log level 0 ", logger.GetSink().Enabled(3))

		flag.Parsed()

		logger.V(2).Info("debug v2")`
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 18, 2022
@pohly
Copy link

pohly commented Aug 18, 2022

Is this perhaps a duplicate of #336?

@elegantm
Copy link
Author

Is this perhaps a duplicate of #336?

yeah, the same feature issue

@pohly
Copy link

pohly commented Aug 19, 2022

/close

Duplicate of #336.

@k8s-ci-robot
Copy link

@pohly: Closing this issue.

In response to this:

/close

Duplicate of #336.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants