| 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 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:developer' as developer; | 6 import 'dart:developer' as developer; |
| 7 import 'package:logging/logging.dart'; | 7 import 'package:logging/logging.dart'; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 Logger.root.level = Level.ALL; | 10 Logger.root.level = Level.ALL; |
| 11 Logger.root.onRecord.listen((logRecord) { | 11 Logger.root.onRecord.listen((logRecord) { |
| 12 developer.log( | 12 developer.log( |
| 13 logRecord.message, | 13 logRecord.message, |
| 14 time: logRecord.time, | 14 time: logRecord.time, |
| 15 sequenceNumber: logRecord.sequenceNumber, | 15 sequenceNumber: logRecord.sequenceNumber, |
| 16 level: logRecord.level.value, | 16 level: logRecord.level.value, |
| 17 name: logRecord.loggerName, | 17 name: logRecord.loggerName, |
| 18 zone: null, | 18 zone: null, |
| 19 error: logRecord.error, | 19 error: logRecord.error, |
| 20 stackTrace: logRecord.stackTrace); | 20 stackTrace: logRecord.stackTrace); |
| 21 }); | 21 }); |
| 22 new Timer.periodic(new Duration(seconds: 1), (t) { | 22 new Timer.periodic(new Duration(seconds: 1), (t) { |
| 23 Logger.root.info('INFO MESSAGE'); | 23 Logger.root.info('INFO MESSAGE'); |
| 24 }); | 24 }); |
| 25 new Timer.periodic(new Duration(seconds: 1), (t) { | 25 new Timer.periodic(new Duration(seconds: 1), (t) { |
| 26 Logger.root.fine('FINE MESSAGE'); | 26 Logger.root.fine('FINE MESSAGE'); |
| 27 }); | 27 }); |
| 28 } | 28 } |
| OLD | NEW |