Add METEOR_PRINT_CONSTRAINT_SOLVER_INPUT env var

Very useful for us or users to run!  If there's a bug anywhere in the
constraint-solver or logic-solver package that comes up when using
the tool, we can probably reproduce it just by feeding the JSON that's
printed out into the constraint-solver in a test.
This commit is contained in:
David Greenspan
2015-03-12 17:44:46 -07:00
parent a75b0a441a
commit e8e7ec43bf

View File

@@ -70,6 +70,12 @@ CS.PackagesResolver.prototype.resolve = function (dependencies, constraints,
CS.PackagesResolver._resolveWithInput = function (input, options) {
options = options || {};
if (Meteor.isServer &&
process.env['METEOR_PRINT_CONSTRAINT_SOLVER_INPUT']) {
console.log("CONSTRAINT_SOLVER_INPUT = ");
console.log(JSON.stringify(input.toJSONable(), null, 2));
}
var solver = new CS.Solver(input, {
nudge: options.nudge
});