Index: sdk/lib/_internal/pub/lib/src/log.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/log.dart b/sdk/lib/_internal/pub/lib/src/log.dart |
index bbbcb3c95f5bcf6250c0bb6a50276778c4303e1c..f1726bba72184d1122427ce9c6040bcea52344d2 100644 |
--- a/sdk/lib/_internal/pub/lib/src/log.dart |
+++ b/sdk/lib/_internal/pub/lib/src/log.dart |
@@ -8,6 +8,8 @@ library pub.log; |
import 'dart:async'; |
import 'dart:io'; |
+import 'package:path/path.dart' as p; |
+ |
import 'io.dart'; |
import 'transcript.dart'; |
import 'utils.dart'; |
@@ -152,30 +154,32 @@ Future ioAsync(String startMessage, Future operation, |
/// Logs the spawning of an [executable] process with [arguments] at [IO] |
/// level. |
-void process(String executable, List<String> arguments) { |
- io("Spawning $executable ${arguments.join(' ')}"); |
+void process(String executable, List<String> arguments, |
+ String workingDirectory) { |
+ io("Spawning \"$executable ${arguments.join(' ')}\" in " |
+ "${p.absolute(workingDirectory)}"); |
} |
/// Logs the results of running [executable]. |
void processResult(String executable, PubProcessResult result) { |
// Log it all as one message so that it shows up as a single unit in the logs. |
var buffer = new StringBuffer(); |
- buffer.write("Finished $executable. Exit code ${result.exitCode}."); |
+ buffer.writeln("Finished $executable. Exit code ${result.exitCode}."); |
dumpOutput(String name, List<String> output) { |
if (output.length == 0) { |
- buffer.write("Nothing output on $name."); |
+ buffer.writeln("Nothing output on $name."); |
} else { |
- buffer.write("$name:"); |
+ buffer.writeln("$name:"); |
var numLines = 0; |
for (var line in output) { |
if (++numLines > 1000) { |
- buffer.write('[${output.length - 1000}] more lines of output ' |
+ buffer.writeln('[${output.length - 1000}] more lines of output ' |
'truncated...]'); |
break; |
} |
- buffer.write(line); |
+ buffer.writeln("| $line"); |
} |
} |
} |
@@ -183,7 +187,7 @@ void processResult(String executable, PubProcessResult result) { |
dumpOutput("stdout", result.stdout); |
dumpOutput("stderr", result.stderr); |
- io(buffer.toString()); |
+ io(buffer.toString().trim()); |
} |
/// Enables recording of log entries. |