| 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 library utils; | 5 library utils; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'path.dart'; | 10 import 'path.dart'; |
| 11 | 11 |
| 12 // This is the maximum time we expect stdout/stderr of subprocesses to deliver | 12 // This is the maximum time we expect stdout/stderr of subprocesses to deliver |
| 13 // data after we've got the exitCode. | 13 // data after we've got the exitCode. |
| 14 const Duration MAX_STDIO_DELAY = const Duration(seconds: 30); | 14 const Duration MAX_STDIO_DELAY = const Duration(seconds: 30); |
| 15 | 15 |
| 16 String MAX_STDIO_DELAY_PASSED_MESSAGE = | 16 String MAX_STDIO_DELAY_PASSED_MESSAGE = |
| 17 """Not waiting for stdout/stderr from subprocess anymore | 17 """Not waiting for stdout/stderr from subprocess anymore |
| 18 ($MAX_STDIO_DELAY passed). Please note that this could be an indicator | 18 ($MAX_STDIO_DELAY passed). Please note that this could be an indicator |
| 19 that there is a hanging process which we were unable to kill."""; | 19 that there is a hanging process which we were unable to kill."""; |
| 20 | 20 |
| 21 class DebugLogger { | 21 class DebugLogger { |
| 22 static IOSink _sink; | 22 static IOSink _sink; |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * If [path] was null, the DebugLogger will write messages to stdout. | 25 * If [path] was null, the DebugLogger will write messages to stdout. |
| 26 */ | 26 */ |
| 27 static init(Path path, {append: false}) { | 27 static init(Path path, {append: false}) { |
| 28 if (path != null) { | 28 if (path != null) { |
| 29 var mode = append ? FileMode.APPEND : FileMode.WRITE; | 29 var mode = append ? FileMode.APPEND : FileMode.WRITE; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 class UniqueObject { | 303 class UniqueObject { |
| 304 static int _nextId = 1; | 304 static int _nextId = 1; |
| 305 final int _hashCode; | 305 final int _hashCode; |
| 306 | 306 |
| 307 int get hashCode => _hashCode; | 307 int get hashCode => _hashCode; |
| 308 operator ==(other) => other is UniqueObject && _hashCode == other._hashCode; | 308 operator ==(other) => other is UniqueObject && _hashCode == other._hashCode; |
| 309 | 309 |
| 310 UniqueObject() : _hashCode = ++_nextId; | 310 UniqueObject() : _hashCode = ++_nextId; |
| 311 } | 311 } |
| OLD | NEW |