OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override | |
5 | 4 |
6 import 'dart:developer' as developer; | 5 import 'dart:developer' as developer; |
7 import 'package:observatory/service_io.dart'; | 6 import 'package:observatory/service_io.dart'; |
8 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
9 import 'package:logging/logging.dart'; | 8 import 'package:logging/logging.dart'; |
10 | 9 |
11 import 'test_helper.dart'; | 10 import 'test_helper.dart'; |
12 | 11 |
13 void init() { | 12 void init() { |
14 Logger.root.level = Level.ALL; | 13 Logger.root.level = Level.ALL; |
15 Logger.root.onRecord.listen((logRecord) { | 14 Logger.root.onRecord.listen((logRecord) { |
16 developer.log( | 15 developer.log( |
| 16 logRecord.message, |
| 17 time: logRecord.time, |
17 sequenceNumber: logRecord.sequenceNumber, | 18 sequenceNumber: logRecord.sequenceNumber, |
18 millisecondsSinceEpoch: logRecord.time.millisecondsSinceEpoch, | |
19 level: logRecord.level.value, | 19 level: logRecord.level.value, |
20 name: logRecord.loggerName, | 20 name: logRecord.loggerName, |
21 message: logRecord.message, | |
22 zone: null, | 21 zone: null, |
23 error: logRecord.error, | 22 error: logRecord.error, |
24 stackTrace: logRecord.stackTrace); | 23 stackTrace: logRecord.stackTrace); |
25 }); | 24 }); |
26 } | 25 } |
27 | 26 |
28 void run() { | 27 void run() { |
29 developer.debugger(); | 28 developer.debugger(); |
30 Logger.root.fine('Hey Buddy!'); | 29 Logger.root.fine('Hey Buddy!'); |
31 developer.debugger(); | 30 developer.debugger(); |
(...skipping 15 matching lines...) Expand all Loading... |
47 expect(event.logRecord['level'], equals(Level.INFO)); | 46 expect(event.logRecord['level'], equals(Level.INFO)); |
48 expect(event.logRecord['message'].valueAsString, equals('YES')); | 47 expect(event.logRecord['message'].valueAsString, equals('YES')); |
49 expect(event.logRecord['time'], new isInstanceOf<DateTime>()); | 48 expect(event.logRecord['time'], new isInstanceOf<DateTime>()); |
50 }), | 49 }), |
51 ]; | 50 ]; |
52 | 51 |
53 main(args) => runIsolateTests(args, | 52 main(args) => runIsolateTests(args, |
54 tests, | 53 tests, |
55 testeeBefore: init, | 54 testeeBefore: init, |
56 testeeConcurrent: run); | 55 testeeConcurrent: run); |
OLD | NEW |