| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /// Message logging. | 5 /// Message logging. |
| 6 library log; | 6 library log; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'io.dart'; | 9 import 'io.dart'; |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } else { | 103 } else { |
| 104 io(endMessage(result)); | 104 io(endMessage(result)); |
| 105 } | 105 } |
| 106 return result; | 106 return result; |
| 107 }); | 107 }); |
| 108 } | 108 } |
| 109 | 109 |
| 110 /// Logs the spawning of an [executable] process with [arguments] at [IO] | 110 /// Logs the spawning of an [executable] process with [arguments] at [IO] |
| 111 /// level. | 111 /// level. |
| 112 void process(String executable, List<String> arguments) { | 112 void process(String executable, List<String> arguments) { |
| 113 io("Spawning $executable ${Strings.join(arguments, ' ')}"); | 113 io("Spawning $executable ${arguments.join(' ')}"); |
| 114 } | 114 } |
| 115 | 115 |
| 116 /// Logs the results of running [executable]. | 116 /// Logs the results of running [executable]. |
| 117 void processResult(String executable, PubProcessResult result) { | 117 void processResult(String executable, PubProcessResult result) { |
| 118 // Log it all as one message so that it shows up as a single unit in the logs. | 118 // Log it all as one message so that it shows up as a single unit in the logs. |
| 119 var buffer = new StringBuffer(); | 119 var buffer = new StringBuffer(); |
| 120 buffer.add("Finished $executable. Exit code ${result.exitCode}."); | 120 buffer.add("Finished $executable. Exit code ${result.exitCode}."); |
| 121 | 121 |
| 122 dumpOutput(String name, List<String> output) { | 122 dumpOutput(String name, List<String> output) { |
| 123 if (output.length == 0) { | 123 if (output.length == 0) { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 sink.add(' | '.charCodes); | 219 sink.add(' | '.charCodes); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 sink.add(line.charCodes); | 223 sink.add(line.charCodes); |
| 224 sink.add('\n'.charCodes); | 224 sink.add('\n'.charCodes); |
| 225 | 225 |
| 226 firstLine = false; | 226 firstLine = false; |
| 227 } | 227 } |
| 228 } | 228 } |
| OLD | NEW |