Use debug instead of console
This commit is contained in:
parent
7fd870cfd2
commit
361dd00e9d
@ -2,6 +2,7 @@ var assert = require('assert');
|
||||
|
||||
var _ = require('underscore');
|
||||
var step = require('step');
|
||||
var debug = require('debug')('windshaft:cartodb');
|
||||
|
||||
var LZMA = require('lzma').LZMA;
|
||||
var lzmaWorker = new LZMA();
|
||||
@ -181,7 +182,7 @@ BaseController.prototype.send = function(req, res, body, status, headers) {
|
||||
// See http://github.com/CartoDB/Windshaft/issues/166
|
||||
req.profiler.sendStats();
|
||||
} catch (err) {
|
||||
console.error("error sending profiling stats: " + err);
|
||||
debug("error sending profiling stats: " + err);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -192,12 +193,7 @@ BaseController.prototype.sendError = function(req, res, err, label) {
|
||||
|
||||
var statusCode = findStatusCode(err);
|
||||
|
||||
// use console.log for statusCode != 500 ?
|
||||
if (statusCode >= 500) {
|
||||
console.error('[%s ERROR] -- %d: %s', label, statusCode, err);
|
||||
} else {
|
||||
console.warn('[%s WARN] -- %d: %s', label, statusCode, err);
|
||||
}
|
||||
debug('[%s ERROR] -- %d: %s', label, statusCode, err);
|
||||
|
||||
// If a callback was requested, force status to 200
|
||||
if (req.query && req.query.callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user