Browse Source

Remove expensive JSON.stringify from api debug logging calls

pull/445/head
Vesa Meskanen 9 years ago
parent
commit
a2e96987fc
  1. 4
      controller/place.js
  2. 4
      controller/search.js

4
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 ) { service.mget( backend, query, function( err, docs ) {
console.log('err:' + err); console.log('err:' + err);
@ -35,7 +35,7 @@ function setup( backend ){
else { else {
res.data = docs; res.data = docs;
} }
logger.debug('[ES response]', JSON.stringify(docs)); logger.debug('[ES response]', docs);
next(); next();
}); });

4
controller/search.js

@ -29,7 +29,7 @@ function setup( backend, query ){
cmd.type = req.clean.layers; cmd.type = req.clean.layers;
} }
logger.debug( '[ES req]', JSON.stringify(cmd) ); logger.debug( '[ES req]', cmd );
// query backend // query backend
service.search( backend, cmd, function( err, docs, meta ){ service.search( backend, cmd, function( err, docs, meta ){
@ -43,7 +43,7 @@ function setup( backend, query ){
res.data = docs; res.data = docs;
res.meta = meta; res.meta = meta;
} }
logger.debug('[ES response]', JSON.stringify(docs)); logger.debug('[ES response]', docs);
next(); next();
}); });

Loading…
Cancel
Save