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

Unified Diff: utils/pub/entrypoint.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/curl_client.dart ('k') | utils/pub/git.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/entrypoint.dart
diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart
index d3af1fa53f92055e85d854aeed926ee7909ad1ed..b9585d5649867d7af94b71759d59fa1b039c85dc 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -6,6 +6,7 @@ library entrypoint;
import 'io.dart';
import 'lock_file.dart';
+import 'log.dart' as log;
import 'package.dart';
import 'root_source.dart';
import 'system_cache.dart';
@@ -87,6 +88,7 @@ class Entrypoint {
if (!exists) return new Future.immediate(null);
// TODO(nweiz): figure out when to actually delete the directory, and when
// we can just re-use the existing symlink.
+ log.fine("Deleting package directory for ${id.name} before install.");
return deleteDir(packageDir);
}).chain((_) {
if (id.source.shouldCache) {
@@ -167,6 +169,8 @@ class Entrypoint {
Future<LockFile> _loadLockFile() {
var completer = new Completer<LockFile>();
var lockFilePath = join(root.dir, 'pubspec.lock');
+
+ log.fine("Loading lockfile.");
var future = readTextFile(lockFilePath);
future.handleException((_) {
@@ -174,8 +178,9 @@ class Entrypoint {
// probably wrong and we should notify the user.
fileExists(lockFilePath).transform((exists) {
if (!exists) return;
- printError("Error reading pubspec.lock: ${future.exception}");
+ log.error("Error reading pubspec.lock: ${future.exception}");
}).then((_) {
+ log.fine("No lock file at $lockFilePath, creating empty one.");
completer.complete(new LockFile.empty());
});
@@ -196,7 +201,9 @@ class Entrypoint {
if (id.source is! RootSource) lockFile.packages[id.name] = id;
}
- return writeTextFile(join(root.dir, 'pubspec.lock'), lockFile.serialize());
+ var lockFilePath = join(root.dir, 'pubspec.lock');
+ log.fine("Saving lockfile.");
+ return writeTextFile(lockFilePath, lockFile.serialize());
}
/**
« no previous file with comments | « utils/pub/curl_client.dart ('k') | utils/pub/git.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698