Introduce debug instead of console.log

This commit is contained in:
Gaël Métais
2014-11-28 17:53:39 +01:00
parent 2a316ebb1e
commit 6089e5fe20
5 changed files with 31 additions and 17 deletions
+10
View File
@@ -1,4 +1,5 @@
var Q = require('q');
var debug = require('debug')('ylt:ruleschecker');
var RulesChecker = function() {
'use strict';
@@ -8,6 +9,8 @@ var RulesChecker = function() {
var results = {};
var err = null;
debug('Starting checking rules');
for (var metricName in policies) {
var policy = policies[metricName];
@@ -38,9 +41,16 @@ var RulesChecker = function() {
rule.abnormalityScore = Math.min(Math.round(abnormalityScore), 0);
results[metricName] = rule;
} else {
debug('Metric %s not found for tool %s', metricName, policy.tool);
}
}
debug('Rules checking finished');
return results;
};
};