Skip to content

Commit

Permalink
add a logger
Browse files Browse the repository at this point in the history
  • Loading branch information
spinegar committed Jan 26, 2018
1 parent c2c53b6 commit 9c21a60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ function checkIfTrading(market) {

function saveMarketsToDb(markets) {
return new Promise.each(markets, (market) => {
console.log('saving pair ' + market + ' to db');
logger.info('saving pair ' + market + ' to db');
return saveMarket(market);
});
}
Expand All @@ -144,6 +142,11 @@ function saveMarket(market) {
Crypto.findOne({id: market.id, exchange: market.exchange}).exec((err, result) => {
if(err) return reject(err);

if(!result) {
console.log('saving pair ' + market.id + ' to db');
logger.info('saving pair ' + market.id + ' to db');
}

upsertCrypto(market).then(() => {
if(!result && !firstRun) {
notifySubscribersListed(market).then(resolve).catch(reject);
Expand Down

0 comments on commit 9c21a60

Please sign in to comment.