-
New Lazy message construction — pass
() => 'expensive $message'to any log method.
The lambda is only called when the log level passes the filter, avoiding unnecessary string allocations. -
New Lazy log builders —
traceLazy,debugLazy,infoLazy,noticeLazy,successLazy,warningLazy,errorLazy,criticalLazy,wtfLazy, andlogLazy(with alevel:argument) — defer the entire log call (message,data,error,stackTrace,formatOptions) until the level filter passes.
Useful when expensive work lives in the structureddatamap, not just the message string.Chirp.warningLazy( (log) => log('snapshot', data: {'state': renderState()}), );
Matching
Chirp.*Lazystatic forwarders are exposed on the global logger.
Caller resolution lands on thexxxLazy(...)invocation line, not the inner(log) => ...lambda body, so eager and lazy calls report consistent source locations.
Adds theChirpLogFntypedef for the innerlogcallback.