logger_builder 0.3.3
logger_builder: ^0.3.3 copied to clipboard
A toolkit for creating your own customizable and hierarchical loggers in Dart.
0.3.3 #
AsyncPublisherWithBuffer/AsyncPublisherWithBufferAndParam:flush()no longer hangs on an idle queue — it completes immediately. Flush has drain semantics: it also waits for logs published after the call, until the buffer becomes empty.- All async publishers: a new optional
onErrorcallback receives errors thrown by the handler; without it, the error is reported to the current zone (same asMultiPublisher). A throwing handler no longer stalls the queue, loses the retry buffer, or leavesflush()hanging. - All async publishers: a new
isClosedgetter.publishafterclose()now always throws aStateError(buffered publishers used to silently accept logs into a dead buffer);flush()afterclose()completes immediately instead of resurrecting the publisher; repeatedclose()calls are no-ops returning the same future. AsyncPublisher/AsyncPublisherWithParam: concurrentflush()calls are now serialized — an overlapping flush no longer hangs forever and no longer loses queued logs.- Buffered publishers:
close()now drains the queue completely — logs published while a batch was in flight are processed instead of being silently dropped. Entries returned to the retry buffer after closing are dropped by design (documented). - All async publishers: an
onErrorcallback that itself throws can no longer stall the queue; the secondary error is reported to the current zone and processing continues. AsyncFormatterfamily: whenOutisObject?/dynamic, an asynchronousformatresult is now awaited instead of being passed tooutputas an unresolvedFuture.AsyncFormatterWithBuffer/AsyncFormatterWithBufferAndParam: the batch passed tooutputnow reflects retry-buffer additions made during an asynchronousformat.TypedLazy(LazyString,LazyStringOrNull): readingresolvedaftervaluenow returns the converted value instead of leaking an internal sentinel object.LazyString.resolved: the defaultfallbackValueis now'null', same as the main constructor.CustomLevelLogger: an emptynamenow throws anArgumentErrorin all build modes (previously an assert, and aRangeErrorin release); the defaultshortNameis the first code point of the name, correct for non-BMP characters.- Hierarchy: setting a per-level publisher on a logger no longer throws mid-propagation when a sublogger did not register that level.
- Hierarchy: sublogger bookkeeping no longer uses a
Finalizerthat kept the parent logger strongly reachable through its live subloggers; dead weak references are pruned automatically during traversals. - Internal stream subscriptions are now stored and cancelled on
close(). - Docs: dartdoc for
HasFlush, async publisher members, theLazyfamily,Levelsconstants andCustomLog.zone. - Tests: the async publisher family, the
Lazyfamily, and level/hierarchy edge cases are now covered (63 new tests).
0.3.2 #
MultiPublisher: an exception thrown by one publisher no longer interrupts publishing to the remaining publishers and no longer propagates to the logging call site. The newonErrorcallback receives the failing publisher along with the error; without it, the error is reported to the current zone as an uncaught asynchronous error.MultiPublisher.flush: a synchronous throw from one publisher'sflushno longer prevents flushing the others.
0.3.0-0.3.1 #
- [breaking changes] Refactor a builder and a printer to one publisher.
- Add the async publisher family:
AsyncPublisher,AsyncPublisherWithParam,AsyncPublisherWithBuffer,AsyncPublisherWithBufferAndParamandMultiPublisher(recorded retroactively). - Upgrade ansi_escape_codes to 3.0.2 for examples.
0.2.0 #
- [breaking changes] Rename
LazyStringtoLazyStringOrNullandLazyNonNullableStringtoLazyString. - Refactor
hierarchical_logger.dartexample to useLazyStringfor path.
0.1.3-0.1.4 #
- Fix bug with builder and printer inheritance in subloggers.
0.1.2 #
- Add a CI badge to README.
- Remove vm_service from example.
- Add GitHub Actions for CI.
- Downgrade Dart SDK constraint to 3.2.0.
- Downgrade meta to 1.16.0.
0.1.0-0.1.1 #
- Initial version.