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

Side by Side Diff: runtime/observatory/tests/ui/log.dart

Issue 1266053003: Make dart:developer log more user friendly (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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:async'; 5 import 'dart:async';
7 import 'dart:developer' as developer; 6 import 'dart:developer' as developer;
8 import 'package:logging/logging.dart'; 7 import 'package:logging/logging.dart';
9 8
10 main() { 9 main() {
11 Logger.root.level = Level.ALL; 10 Logger.root.level = Level.ALL;
12 Logger.root.onRecord.listen((logRecord) { 11 Logger.root.onRecord.listen((logRecord) {
13 developer.log( 12 developer.log(
13 logRecord.message,
14 time: logRecord.time,
14 sequenceNumber: logRecord.sequenceNumber, 15 sequenceNumber: logRecord.sequenceNumber,
15 millisecondsSinceEpoch: logRecord.time.millisecondsSinceEpoch,
16 level: logRecord.level.value, 16 level: logRecord.level.value,
17 name: logRecord.loggerName, 17 name: logRecord.loggerName,
18 message: logRecord.message,
19 zone: null, 18 zone: null,
20 error: logRecord.error, 19 error: logRecord.error,
21 stackTrace: logRecord.stackTrace); 20 stackTrace: logRecord.stackTrace);
22 }); 21 });
23 new Timer.periodic(new Duration(seconds: 1), (t) { 22 new Timer.periodic(new Duration(seconds: 1), (t) {
24 Logger.root.info('INFO MESSAGE'); 23 Logger.root.info('INFO MESSAGE');
25 }); 24 });
26 new Timer.periodic(new Duration(seconds: 1), (t) { 25 new Timer.periodic(new Duration(seconds: 1), (t) {
27 Logger.root.fine('FINE MESSAGE'); 26 Logger.root.fine('FINE MESSAGE');
28 }); 27 });
29 } 28 }
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/logging_test.dart ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698