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

Unified Diff: utils/pub/curl_client.dart

Issue 11437019: Add logging system to pub and sprinkle some logging in. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak output. Created 8 years 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 | « utils/pub/command_update.dart ('k') | utils/pub/entrypoint.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/curl_client.dart
diff --git a/utils/pub/curl_client.dart b/utils/pub/curl_client.dart
index e1afc2dbb6c7fc4f77507194669765d4ad97b308..1abb67ed75f9df2410b381bea95937999e83bf74 100644
--- a/utils/pub/curl_client.dart
+++ b/utils/pub/curl_client.dart
@@ -8,6 +8,7 @@ import 'dart:io';
import '../../pkg/http/lib/http.dart' as http;
import 'io.dart';
+import 'log.dart' as log;
import 'utils.dart';
/// A drop-in replacement for [http.Client] that uses the `curl` command-line
@@ -30,10 +31,13 @@ class CurlClient extends http.BaseClient {
/// Sends a request via `curl` and returns the response.
Future<http.StreamedResponse> send(http.BaseRequest request) {
+ log.fine("Sending Curl request $request");
+
var requestStream = request.finalize();
return withTempDir((tempDir) {
var headerFile = new Path(tempDir).append("curl-headers").toNativePath();
var arguments = _argumentsForRequest(request, headerFile);
+ log.process(executable, arguments);
var process;
return Process.start(executable, arguments).chain((process_) {
process = process_;
@@ -114,6 +118,8 @@ class CurlClient extends http.BaseClient {
Future _waitForHeaders(Process process, {bool expectBody}) {
var completer = new Completer();
process.onExit = (exitCode) {
+ log.io("Curl process exited with code $exitCode.");
+
if (exitCode == 0) {
completer.complete(null);
return;
@@ -122,6 +128,7 @@ class CurlClient extends http.BaseClient {
chainToCompleter(consumeInputStream(process.stderr)
.transform((stderrBytes) {
var message = new String.fromCharCodes(stderrBytes);
+ log.fine('Got error reading headers from curl: $message');
if (exitCode == 47) {
throw new RedirectLimitExceededException([]);
} else {
« no previous file with comments | « utils/pub/command_update.dart ('k') | utils/pub/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698