Permalink
Browse files

Move most of the console.log to logger.debug

  • Loading branch information...
1 parent c905750 commit ee20ecb914730bfe363ab4b69a6fb10cc75e46e1 @temas temas committed Mar 19, 2013
Showing with 17 additions and 17 deletions.
  1. +1 −1 lib/nexusClient.js
  2. +2 −2 lib/pipeline.js
  3. +9 −9 lib/podClient.js
  4. +2 −2 lib/push.js
  5. +3 −3 lib/taskman-ng.js
View
@@ -212,7 +212,7 @@ exports.pipelineInject = function(base, entries, auth, cbDone) {
},
auth:lconfig.nexus.auth
};
- console.log("Injecting to nexus");
+ logger.debug("Injecting to nexus");
request.post(params, function(err, res, body) {
if (err) {
logger.warn("Error pipeline injecting with the nexus");
View
@@ -19,7 +19,7 @@ function wrapPumps(timings, pumps, base) {
var pumpPos = 0;
pumps.forEach(function (pump) {
newPumps.push(function (cset, cb) {
- console.log("Pump %d done for %s took %d", pumpPos, idr.toString(base), Date.now() - start);
+ logger.debug("Pump %d done for %s took %d", pumpPos, idr.toString(base), Date.now() - start);
++pumpPos;
timings.push(Date.now() - start);
start = Date.now();
@@ -78,7 +78,7 @@ function pumper(entries, services, auth, cbDone) {
pumps = wrapPumps(timings, pumps, idr.base(entries[0].idr));
async.waterfall(pumps, function (err) {
- console.log("All pumps done: %j", timings);
+ logger.debug("All pumps done: %j", timings);
timings.shift();
cbDone(err, timings);
});
View
@@ -245,15 +245,15 @@ exports.batchSmartAdd = null; // similar, pull out pid->pod, POST raw entries ba
exports.pipelineInject = function(bases, auth, cbDone) {
var completeTimings = [];
var lengths = [];
- console.log("Need to inject for %j", Object.keys(bases));
+ logger.debug("Need to inject for %j", Object.keys(bases));
// For each base we need to check the potential pid and send it out
async.forEach(Object.keys(bases), function(base, cbStep) {
if (bases[base]) lengths.push(bases[base].length);
var pid = idr.pid(base);
if (pid) {
// Oh we have a pid check for the pod id
profileManager.loadProfile(pid, function(err, profile) {
- console.log("Inject to %j", profile);
+ logger.debug("Inject to %j", profile);
if (err || !profile.pod) {
if (role === "apihost" && lconfig.pods.enabled) {
return nexusClient.pipelineInject(base, bases[base], auth,
@@ -262,7 +262,7 @@ exports.pipelineInject = function(bases, auth, cbDone) {
cbStep(err);
});
} else {
- console.log("Running a local inject for %s of %d entries!", base, Array.isArray(bases[base]) ? bases[base].length : 0);
+ logger.debug("Running a local inject for %s of %d entries!", base, Array.isArray(bases[base]) ? bases[base].length : 0);
if (!Array.isArray(bases[base])) {
logger.error("Busted entry is not an array");
return cbStep();
@@ -276,13 +276,13 @@ exports.pipelineInject = function(bases, auth, cbDone) {
var singleBase = {};
singleBase[base] = bases[base];
return pipeline.inject(singleBase, auth, function(err, timings) {
- console.log("Inject complete for %s", base);
+ logger.debug("Inject complete for %s", base);
if (timings) completeTimings.push(timings);
cbStep(err);
});
}
}
- console.log("Sending the inject to a pod");
+ logger.debug("Sending the inject to a pod");
// Send it to the pod
podRequest(podUrl(profile.pod, "/pipelineInject"), {
method: "POST",
@@ -300,17 +300,17 @@ exports.pipelineInject = function(bases, auth, cbDone) {
});
});
} else {
- console.log("Fallback inject");
+ logger.debug("Fallback inject");
return nexusClient.pipelineInject(base, bases[base], auth, function(err, timings) {
if (timings) completeTimings.push(timings);
cbStep(err);
});
}
}, function(err) {
//console.log(err);
- console.log(Object.keys(bases));
- console.log(lengths);
- console.log(completeTimings);
+ logger.debug(Object.keys(bases));
+ logger.debug(lengths);
+ logger.debug(completeTimings);
if (completeTimings && completeTimings.length > 0) {
completeTimings = completeTimings.reduce(function(prev, cur, index, array) {
var res = [];
View
@@ -28,10 +28,10 @@ exports.pump = function(cset, auth, cbDone) {
var bases = {};
var oembeds = {};
- console.log("Checking routes");
+ logger.debug("Checking routes");
// and begins our async cascade
getRoutes(auth, function(routes) {
- console.log("Got routes %j", routes);
+ logger.debug("Got routes %j", routes);
if (Object.keys(routes).length === 0) {
return cbDone(null, cset);
}
View
@@ -69,7 +69,7 @@ var lastHeartbeat = Date.now();
function checkLag(tag) {
var lag = toobusy.lag();
if (lag > 100) {
- console.log(tag + " lag: " + lag + " is toobusy? " + toobusy());
+ logger.debug(tag + " lag: " + lag + " is toobusy? " + toobusy());
}
}
@@ -369,7 +369,7 @@ function runTask(profileInfo, task, fnCallback) {
var cfg = response.config;
function finishCleanup(err) {
- console.log("Cleaning up synclet: %s", task.idr);
+ logger.debug("Cleaning up synclet: %s", task.idr);
var configUpdate = cfg;
// if it is sandboxed, namespace it to this synclet's name
if (sandboxed) {
@@ -452,7 +452,7 @@ function runTask(profileInfo, task, fnCallback) {
// In case something in the synclet immediately barfs...
try {
- console.log("Starting synclet: %s", task.idr);
+ logger.debug("Starting synclet: %s", task.idr);
servezas.synclet(task.service, task.synclet).sync(profileInfo, cleanup);
} catch (E) {
cleanup(E);

0 comments on commit ee20ecb

Please sign in to comment.