Skip to content

Feature request; GetV() function #149

@uablrek

Description

@uablrek

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions