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

Unified Diff: utils/pub/version_solver.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/validator.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/version_solver.dart
diff --git a/utils/pub/version_solver.dart b/utils/pub/version_solver.dart
index 31baa9ce9a9ee87e83d26acade99aa01cbca178e..1a84aa255bd0ba2a14adf6323e2c84823df893d5 100644
--- a/utils/pub/version_solver.dart
+++ b/utils/pub/version_solver.dart
@@ -40,6 +40,7 @@ library version_solver;
import 'dart:json';
import 'dart:math';
import 'lock_file.dart';
+import 'log.dart' as log;
import 'package.dart';
import 'pubspec.dart';
import 'root_source.dart';
@@ -59,7 +60,7 @@ import 'version.dart';
*/
Future<List<PackageId>> resolveVersions(SourceRegistry sources, Package root,
LockFile lockFile) {
- print('Resolving dependencies...');
+ log.message('Resolving dependencies...');
return new VersionSolver(sources, root, lockFile).solve();
}
@@ -267,6 +268,8 @@ class ChangeVersion implements WorkItem {
}
Future process(VersionSolver solver) {
+ log.fine("Changing $package to version $version.");
+
var dependency = solver.getDependency(package);
var oldVersion = dependency.version;
solver.setVersion(package, version);
@@ -418,6 +421,8 @@ class AddConstraint extends ChangeConstraint {
AddConstraint(this.depender, this.ref);
Future process(VersionSolver solver) {
+ log.fine("Adding $depender's constraint $ref.");
+
var dependency = solver.getDependency(ref.name);
var oldDependency = dependency.clone();
dependency.placeConstraint(depender, ref);
@@ -449,6 +454,8 @@ class RemoveConstraint extends ChangeConstraint {
RemoveConstraint(this.depender, this.dependent);
Future process(VersionSolver solver) {
+ log.fine("Removing $depender's constraint ($_removed) on $dependent.");
+
var dependency = solver.getDependency(dependent);
var oldDependency = dependency.clone();
_removed = dependency.removeConstraint(depender);
@@ -468,6 +475,8 @@ class UnlockPackage implements WorkItem {
UnlockPackage(this.package);
Future process(VersionSolver solver) {
+ log.fine("Unlocking ${package.name}.");
+
solver.lockFile.packages.remove(package.name);
return solver.getBestVersion(package).transform((best) {
if (best == null) return null;
« no previous file with comments | « utils/pub/validator.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698