dispose method

  1. @override
void dispose()
override

Releases any resources held by this printer (timers, file handles, network sockets, etc.).

Default implementation is a no-op for stateless printers. Stateful printers MUST override — for example, ThrottledPrinter cancels its drain timer, and RotatingFilePrinter schedules its async close() and returns immediately.

HyperLogger.init(printer: ...) calls dispose on the previous printer when replacing it, so users replacing the global printer at runtime don't leak resources.

Implementations should be idempotent — multiple calls must not crash. Async cleanup (e.g. file flushing) belongs on a separate close() method that callers explicitly await; dispose runs synchronously and best-effort.

Implementation

@override
void dispose() {/* stateless */}