You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 1.x dlog.Logger interface is simple-to-implement but "slow" in that non-logged formatting can't be optimized out. Implementations can opt-in to such an optimization by also implementing the dlog.OptmizedLogger interface, but it's more complex.
There's some thinking that it's a design flaw that it's so easy to do the slow thing.
logr.LogSink has an .Enabled(level) method that can be used to implement this optimization, without delegating formatting to the backend. However, this limits the backend to only be able to filter based on the loglevel, and nothing else.
The 1.x
dlog.Logger
interface is simple-to-implement but "slow" in that non-logged formatting can't be optimized out. Implementations can opt-in to such an optimization by also implementing thedlog.OptmizedLogger
interface, but it's more complex.There's some thinking that it's a design flaw that it's so easy to do the slow thing.
See the discussion on #33
The text was updated successfully, but these errors were encountered: