diff --git a/lib/cartodb/controllers/layergroup.js b/lib/cartodb/controllers/layergroup.js index a1f13999..a4421950 100644 --- a/lib/cartodb/controllers/layergroup.js +++ b/lib/cartodb/controllers/layergroup.js @@ -241,7 +241,7 @@ LayergroupController.prototype.sendResponse = function(req, res, body, status, h function sendResponse(err, affectedTables) { req.profiler.done('affectedTables'); if (err) { - console.log('ERROR generating cache channel: ' + err); + global.logger.log('ERROR generating cache channel: ' + err); } if (!!affectedTables) { var tablesCacheEntry = new TablesCacheEntry(dbName, affectedTables); diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index 00d6d317..b72c7c1c 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -264,7 +264,7 @@ MapController.prototype.afterLayergroupCreate = function(req, res, mapconfig, la req.profiler.done('incMapviewCount'); } if ( err ) { - console.log("ERROR: failed to increment mapview count for user '" + username + "': " + err); + global.logger.log("ERROR: failed to increment mapview count for user '" + username + "': " + err); } done(); }); diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index bc6f7654..6bb6d2e8 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -48,7 +48,7 @@ NamedMapsController.prototype.sendResponse = function(req, res, resource, header function sendResponse(err, result) { req.profiler.done('affectedTables'); if (err) { - console.log('ERROR generating cache channel: ' + err); + global.logger.log('ERROR generating cache channel: ' + err); } if (!result || !!result.affectedTables) { // we increase cache control as we can invalidate it diff --git a/lib/cartodb/models/cdb_request.js b/lib/cartodb/models/cdb_request.js index db5c93ea..27c101f0 100644 --- a/lib/cartodb/models/cdb_request.js +++ b/lib/cartodb/models/cdb_request.js @@ -14,12 +14,11 @@ CdbRequest.prototype.userByReq = function(req) { } var mat = host.match(this.RE_USER_FROM_HOST); if ( ! mat ) { - console.error("Pattern '" + this.RE_USER_FROM_HOST + "' does not match hostname '" + host + "'"); + global.logger.error("Pattern '%s' does not match hostname '%s'", this.RE_USER_FROM_HOST, host); return; } - // console.log("Matches: "); console.dir(mat); if ( mat.length !== 2 ) { - console.error("Pattern '" + this.RE_USER_FROM_HOST + "' gave unexpected matches against '" + host + "': ", mat); + global.logger.error("Pattern '%s' gave unexpected matches against '%s': %s", this.RE_USER_FROM_HOST, host, mat); return; } return mat[1]; diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index 2a9c67ae..672c1f6b 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -78,9 +78,9 @@ module.exports = function(serverOptions) { error: !!err ? JSON.stringify(err.message) : undefined }); if (err) { - console.warn(logMessage); + global.logger.warn(logMessage); } else { - console.info(logMessage); + global.logger.info(logMessage); } }); } diff --git a/lib/cartodb/stats/client.js b/lib/cartodb/stats/client.js index b8b09a89..614344cb 100644 --- a/lib/cartodb/stats/client.js +++ b/lib/cartodb/stats/client.js @@ -40,7 +40,6 @@ module.exports = { if (count > 1) { debug("last statsd client socket error repeated " + count + " times"); instance.last_error.count = 1; - //console.log("Clearing interval"); clearInterval(instance.last_error.interval); instance.last_error.interval = null; }