| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 library logging_test; | 6 library logging_test; |
| 7 | 7 |
| 8 import 'package:logging/logging.dart'; | 8 import 'package:logging/logging.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 'INFO: 5', | 272 'INFO: 5', |
| 273 'WARNING: 6', | 273 'WARNING: 6', |
| 274 'SEVERE: 7', | 274 'SEVERE: 7', |
| 275 'SHOUT: 8'])); | 275 'SHOUT: 8'])); |
| 276 }); | 276 }); |
| 277 | 277 |
| 278 test('logging methods store exception', () { | 278 test('logging methods store exception', () { |
| 279 root.level = Level.ALL; | 279 root.level = Level.ALL; |
| 280 var rootMessages = []; | 280 var rootMessages = []; |
| 281 root.onRecord.listen((r) { | 281 root.onRecord.listen((r) { |
| 282 rootMessages.add('${r.level}: ${r.message} ${r.error}'); | 282 rootMessages.add('${r.level}: ${r.message} ${r.exception}'); |
| 283 }); | 283 }); |
| 284 | 284 |
| 285 root.finest('1'); | 285 root.finest('1'); |
| 286 root.finer('2'); | 286 root.finer('2'); |
| 287 root.fine('3'); | 287 root.fine('3'); |
| 288 root.config('4'); | 288 root.config('4'); |
| 289 root.info('5'); | 289 root.info('5'); |
| 290 root.warning('6'); | 290 root.warning('6'); |
| 291 root.severe('7'); | 291 root.severe('7'); |
| 292 root.shout('8'); | 292 root.shout('8'); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 'SHOUT: 10'])); | 417 'SHOUT: 10'])); |
| 418 | 418 |
| 419 expect(cMessages, equals([ | 419 expect(cMessages, equals([ |
| 420 // 1 - 7 are lower in the hierarchy | 420 // 1 - 7 are lower in the hierarchy |
| 421 // 'FINE: 8' is not loggable | 421 // 'FINE: 8' is not loggable |
| 422 'WARNING: 9', | 422 'WARNING: 9', |
| 423 'SHOUT: 10'])); | 423 'SHOUT: 10'])); |
| 424 }); | 424 }); |
| 425 }); | 425 }); |
| 426 } | 426 } |
| OLD | NEW |