forked from golang/glog
-
Notifications
You must be signed in to change notification settings - Fork 224
Open
Labels
kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.priority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
I tried doing
if klog.V(9) {
klog.InfoS("Running nftables transaction", "transaction", tx.String())
}
which I know used to work, but apparently now it doesn't, so I checked the klog sources, and klog.go
says:
// See the documentation for the V function for an explanation of these examples:
//
// if klog.V(2) {
// klog.Info("Starting transaction...")
// }
Ignoring the comment, I dug further and found the Enabled()
function and then it compiled, but it turns out that golangci-lint still doesn't like it:
ERROR: pkg/proxy/nftables/proxier.go:1617:2: the result of klog.V should be stored in a variable and then be used multiple times: if klogV := klog.V(); klogV.Enabled() { ... klogV.Info ... } (logcheck)
ERROR: if klog.V(9).Enabled() {
ERROR: ^
(which, FTR, is a terrible API though I don't have any ideas on fixing it)
The whole introductory doc comment in klog.go
needs a rewrite/update, which maybe ought to be copied to the README?
/kind documentation
Metadata
Metadata
Assignees
Labels
kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.priority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Type
Projects
Status
Needs Triage