This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed
Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ ## 1.1.1-dev
2+
3+ * Add a check that throws if a logger name ends with '.'.
4+
15## 1.1.0
26
37* Add ` Logger.attachedLoggers ` which exposes all loggers created with the
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ class Logger {
7878 if (name.startsWith ('.' )) {
7979 throw ArgumentError ("name shouldn't start with a '.'" );
8080 }
81+ if (name.endsWith ('.' )) {
82+ throw ArgumentError ("name shouldn't end with a '.'" );
83+ }
84+
8185 // Split hierarchical names (separated with '.').
8286 var dot = name.lastIndexOf ('.' );
8387 Logger ? parent;
Original file line number Diff line number Diff line change 11name : logging
2- version : 1.1.0
2+ version : 1.1.1-dev
33
44description : >-
55 Provides APIs for debugging and error logging, similar to loggers in other
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ void main() {
7575 expect (() => Logger ('.c' ), throwsArgumentError);
7676 });
7777
78+ test ('logger name cannot end with a "."' , () {
79+ expect (() => Logger ('a.' ), throwsArgumentError);
80+ expect (() => Logger ('a..d' ), throwsArgumentError);
81+ });
82+
7883 test ('root level has proper defaults' , () {
7984 expect (Logger .root, isNotNull);
8085 expect (Logger .root.parent, null );
You can’t perform that action at this time.
0 commit comments