Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: sdk/lib/_internal/pub/lib/src/log.dart

Issue 145633008: Ensure that a locked git dependency is downloaded correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: forgot the test Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/lib/src/source/git.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/lib/src/source/git.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698