| Index: tools/testing/dart/utils.dart
|
| diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart
|
| index 7c2bbf7ba1bd338e82079a5e9c4972974de508c7..dc7924691e63af8b96972a7aad98056d2e5a6b57 100644
|
| --- a/tools/testing/dart/utils.dart
|
| +++ b/tools/testing/dart/utils.dart
|
| @@ -8,7 +8,7 @@ import 'dart:io';
|
| import 'dart:utf' as utf;
|
|
|
| class DebugLogger {
|
| - static OutputStream _stream;
|
| + static IOSink _sink;
|
|
|
| /**
|
| * If [path] was null, the DebugLogger will write messages to stdout.
|
| @@ -16,14 +16,14 @@ class DebugLogger {
|
| static init(Path path, {append: false}) {
|
| if (path != null) {
|
| var mode = append ? FileMode.APPEND : FileMode.WRITE;
|
| - _stream = new File.fromPath(path).openOutputStream(mode);
|
| + _sink = new File.fromPath(path).openWrite(mode: mode);
|
| }
|
| }
|
|
|
| static void close() {
|
| - if (_stream != null) {
|
| - _stream.close();
|
| - _stream = null;
|
| + if (_sink != null) {
|
| + _sink.close();
|
| + _sink = null;
|
| }
|
| }
|
|
|
| @@ -40,9 +40,8 @@ class DebugLogger {
|
| }
|
|
|
| static void _print(String msg) {
|
| - if (_stream != null) {
|
| - _stream.write(encodeUtf8(msg));
|
| - _stream.write([0x0a]);
|
| + if (_sink != null) {
|
| + _sink.writeln(msg);
|
| } else {
|
| print(msg);
|
| }
|
|
|