forked from golang/glog
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Besides being slightly inefficient, not storing the result of V() in a variable is often also an indication for not using the right call inside the if block: if klog.V(2).Enabled() { klog.InfoS("some log message") } This records the message with v=0. Correct is: if klogV := klog.V(2); klogV.Enabled() { klogV.InfoS("some log message") } Detecting if clauses that do use this condition with a local variable but then incorrectly use different logger inside the if block is a separate problem and not solved yet.
- Loading branch information
Showing
2 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters