Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1149)

Unified Diff: pkg/logging/test/logging_test.dart

Issue 17467008: add logging support for exceptions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/logging/lib/logging.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/logging/test/logging_test.dart
diff --git a/pkg/logging/test/logging_test.dart b/pkg/logging/test/logging_test.dart
index 1af342f5ed173f8e5277af218c7262888690c315..a631e8c56106a66fcaa35256b27ee1b57bf188bf 100644
--- a/pkg/logging/test/logging_test.dart
+++ b/pkg/logging/test/logging_test.dart
@@ -228,6 +228,49 @@ main() {
'SHOUT: 8']));
});
+ test('logging methods store exception', () {
+ root.level = Level.ALL;
+ var rootMessages = [];
+ root.onRecord.listen((r) {
+ rootMessages.add('${r.level}: ${r.message} ${r.exception}');
+ });
+
+ root.finest('1');
+ root.finer('2');
+ root.fine('3');
+ root.config('4');
+ root.info('5');
+ root.warning('6');
+ root.severe('7');
+ root.shout('8');
+ root.finest('1', 'a');
+ root.finer('2', 'b');
+ root.fine('3', ['c']);
+ root.config('4', 'd');
+ root.info('5', 'e');
+ root.warning('6', 'f');
+ root.severe('7', 'g');
+ root.shout('8', 'h');
+
+ expect(rootMessages, equals([
+ 'FINEST: 1 null',
+ 'FINER: 2 null',
+ 'FINE: 3 null',
+ 'CONFIG: 4 null',
+ 'INFO: 5 null',
+ 'WARNING: 6 null',
+ 'SEVERE: 7 null',
+ 'SHOUT: 8 null',
+ 'FINEST: 1 a',
+ 'FINER: 2 b',
+ 'FINE: 3 [c]',
+ 'CONFIG: 4 d',
+ 'INFO: 5 e',
+ 'WARNING: 6 f',
+ 'SEVERE: 7 g',
+ 'SHOUT: 8 h']));
+ });
+
test('message logging - no hierarchy', () {
root.level = Level.WARNING;
var rootMessages = [];
« no previous file with comments | « pkg/logging/lib/logging.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698