-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
The glog.V() function allows;
if glog.V(2) { glog.Info("log this") }
This is the reason;
The second form is shorter but the first is cheaper if logging is off because it does not evaluate its arguments.
To not evaluate the arguments can be very important for instance if a function is called that searches 100,000 objects for some crucial trace info. You do not want to to that if not on trace level, like V(2). Even though the glog implementation is pretty cool I realize it may not be feasable for logr
, but a possibility to read the V-level should be provided.
Metadata
Metadata
Assignees
Labels
No labels