Skip to content

Commit a3a92b1

Browse files
committed
Catch exceptions
Don't let exceptions in one of the outputs crash the logger.
1 parent c5efa73 commit a3a92b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/src/logger.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,14 @@ class Logger {
116116

117117
if (output.isNotEmpty) {
118118
var outputEvent = OutputEvent(level, output);
119-
_output.output(outputEvent);
119+
// Issues with log output should NOT influence
120+
// the main software behavior.
121+
try {
122+
_output.output(outputEvent);
123+
} catch (e, s) {
124+
print(e);
125+
print(s);
126+
}
120127
}
121128
}
122129
}

0 commit comments

Comments
 (0)