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
Matching `Chirp.*Lazy` static forwarders are exposed on the global logger.
13
+
Caller resolution lands on the `xxxLazy(...)` invocation line, not the inner `(log) => ...` lambda body, so eager and lazy calls report consistent source locations.
14
+
Adds the `ChirpLogFn` typedef for the inner `log` callback.
Chirp.errorLazy((log) => log('failed', error: e, stackTrace: st));
503
+
504
+
// logLazy takes a level: argument
505
+
Chirp.logLazy(
506
+
(log) => log('msg', data: {'state': render()}),
507
+
level: ChirpLogLevel.debug,
508
+
);
509
+
```
510
+
511
+
The inner `log` callback has the same shape as the eager method (typedef `ChirpLogFn`), so call sites read identically — minus the wasted work when the log will be discarded.
512
+
513
+
Caller resolution is handled automatically: the `xxxLazy(...)` invocation line is reported, not the inner `(log) => ...` lambda body, so source locations look the same whether the call is eager or lazy.
514
+
515
+
Available variants: `traceLazy`, `debugLazy`, `infoLazy`, `noticeLazy`, `successLazy`, `warningLazy`, `errorLazy`, `criticalLazy`, `wtfLazy`, plus the generic `logLazy` on both `ChirpLogger` instances and the global `Chirp` static API.
516
+
517
+
Lazy builders cost one closure allocation per call when the level passes; the level-filtered hot path stays as cheap as the eager methods.
518
+
Reach for `xxxLazy` when constructing `data` (or other arguments) is expensive; reach for the lazy-message form when only the message is.
519
+
470
520
### Filtering
471
521
472
522
Chirp provides two ways to filter logs:
@@ -893,6 +943,7 @@ See [`examples/simple/bin/`](https://github.com/passsy/chirp/tree/main/examples/
893
943
|[`instance_tracking.dart`](https://github.com/passsy/chirp/blob/main/examples/simple/bin/instance_tracking.dart)| The `.chirp` extension |
0 commit comments