This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1- ## 1.0.3-dev
1+ ## 1.1.0
22
3+ * Add ` Logger.attachedLoggers ` which exposes all loggers created with the
4+ default constructor.
35* Enable the ` avoid_dynamic_calls ` lint.
46
57## 1.0.2
Original file line number Diff line number Diff line change @@ -51,8 +51,11 @@ class Logger {
5151 /// root [Logger] .
5252 StreamController <LogRecord >? _controller;
5353
54- /// Singleton constructor. Calling `new Logger(name)` will return the same
55- /// actual instance whenever it is called with the same string name.
54+ /// Create or find a Logger by name.
55+ ///
56+ /// Calling `Logger(name)` will return the same instance whenever it is called
57+ /// with the same string name. Loggers created with this constructor are
58+ /// retained indefinitely and available through [attachedLoggers] ;
5659 factory Logger (String name) =>
5760 _loggers.putIfAbsent (name, () => Logger ._named (name));
5861
@@ -278,6 +281,11 @@ class Logger {
278281 /// Top-level root [Logger] .
279282 static final Logger root = Logger ('' );
280283
281- /// All [Logger] s in the system.
284+ /// All attached [Logger] s in the system.
282285 static final Map <String , Logger > _loggers = < String , Logger > {};
286+
287+ /// All attached [Logger] s in the system.
288+ ///
289+ /// Loggers created with [Logger.detached] are not included.
290+ static Iterable <Logger > get attachedLoggers => _loggers.values;
283291}
Original file line number Diff line number Diff line change 11name : logging
2- version : 1.0.3-dev
2+ version : 1.1.0
33
44description : >-
55 Provides APIs for debugging and error logging, similar to loggers in other
You can’t perform that action at this time.
0 commit comments