From a2e96987fc4679b7b74a433a212b6086439e62b0 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 10 Mar 2016 10:50:29 +0200 Subject: [PATCH] Remove expensive JSON.stringify from api debug logging calls --- controller/place.js | 4 ++-- controller/search.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/place.js b/controller/place.js index 29acfe8b..a4996a11 100644 --- a/controller/place.js +++ b/controller/place.js @@ -22,7 +22,7 @@ function setup( backend ){ }; }); - logger.debug( '[ES req]', JSON.stringify(query) ); + logger.debug( '[ES req]', query ); service.mget( backend, query, function( err, docs ) { console.log('err:' + err); @@ -35,7 +35,7 @@ function setup( backend ){ else { res.data = docs; } - logger.debug('[ES response]', JSON.stringify(docs)); + logger.debug('[ES response]', docs); next(); }); diff --git a/controller/search.js b/controller/search.js index a564e7b4..b7b226e5 100644 --- a/controller/search.js +++ b/controller/search.js @@ -29,7 +29,7 @@ function setup( backend, query ){ cmd.type = req.clean.layers; } - logger.debug( '[ES req]', JSON.stringify(cmd) ); + logger.debug( '[ES req]', cmd ); // query backend service.search( backend, cmd, function( err, docs, meta ){ @@ -43,7 +43,7 @@ function setup( backend, query ){ res.data = docs; res.meta = meta; } - logger.debug('[ES response]', JSON.stringify(docs)); + logger.debug('[ES response]', docs); next(); });