Logger.detached constructor

  1. String name

Creates a new detached Logger.

Returns a new Logger instance (unlike new Logger, which returns a Logger singleton), which doesn't have any parent or children, and is not a part of the global hierarchical loggers structure.

It can be useful when you just need a local short-living logger, which you'd like to be garbage-collected later.


factory Logger.detached(String name) =>
    Logger._internal(name, null, <String, Logger>{});