From 8d54dcaf0d47a73f9555edbad157ebb1644f35e4 Mon Sep 17 00:00:00 2001
From: "nweiz@google.com" <nweiz@google.com>
Date: Thu, 20 Feb 2014 00:40:20 +0000
Subject: [PATCH] Add a little additional logging to pub's version solver.

This helped me track down issue 16910, and it seemed general enough to
keep.

R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//172873006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@32838 260f80e4-7a28-3924-810f-c04153c831b5
---
 lib/src/solver/backtracking_solver.dart | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/src/solver/backtracking_solver.dart b/lib/src/solver/backtracking_solver.dart
index 6229c6e4..c570b62b 100644
--- a/lib/src/solver/backtracking_solver.dart
+++ b/lib/src/solver/backtracking_solver.dart
@@ -402,14 +402,12 @@ class BacktrackingSolver {
       }
     } else {
       // Otherwise, indent it under the current selected package.
-      message = "| $message";
+      message = prefixLines(message);
     }
 
     // Indent for the previous selections.
-    var buffer = new StringBuffer();
-    buffer.writeAll(_selected.skip(1).map((_) => '| '));
-    buffer.write(message);
-    log.solver(buffer);
+    var prefix = _selected.skip(1).map((_) => '| ').join();
+    log.solver(prefixLines(message, prefix: prefix));
   }
 }
 
@@ -545,7 +543,11 @@ class Traverser {
 
         // See if it's possible for a package to match that constraint.
         if (constraint.isEmpty) {
-          _solver.logSolve('disjoint constraints on ${dep.name}');
+          var constraints = _getDependencies(dep.name)
+              .map((dep) => "  ${dep.dep.constraint} from ${dep.depender}")
+              .join('\n');
+          _solver.logSolve(
+              'disjoint constraints on ${dep.name}:\n$constraints');
           throw new DisjointConstraintException(dep.name, dependencies);
         }
 
-- 
GitLab