OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// Simple wrapper for [Logger] library. | 5 /// Simple wrapper for [Logger] library. |
6 library runtime.log; | 6 library runtime.log; |
7 | 7 |
8 import "package:logging/logging.dart"; | 8 import "package:logging/logging.dart"; |
9 | 9 |
10 /** Log message at level [Level.FINEST]. */ | 10 /** Log message at level [Level.FINEST]. */ |
(...skipping 29 matching lines...) Expand all Loading... |
40 void toConsole() { | 40 void toConsole() { |
41 _logger.onRecord.listen((LogRecord record) { | 41 _logger.onRecord.listen((LogRecord record) { |
42 String levelString = record.level.toString(); | 42 String levelString = record.level.toString(); |
43 while (levelString.length < 6) levelString += ' '; | 43 while (levelString.length < 6) levelString += ' '; |
44 print('${record.time}: ${levelString} ${record.message}'); | 44 print('${record.time}: ${levelString} ${record.message}'); |
45 }); | 45 }); |
46 } | 46 } |
47 | 47 |
48 /// The root [Logger]. | 48 /// The root [Logger]. |
49 final Logger _logger = Logger.root; | 49 final Logger _logger = Logger.root; |
OLD | NEW |