From f720c0e028009bf62aed6a8491185698e3a79afc Mon Sep 17 00:00:00 2001 From: baldo Date: Sun, 26 Jun 2016 12:58:40 +0200 Subject: [PATCH] Less verbose logging on INFO. See: https://github.com/freifunkhamburg/ffffng/issues/18 --- server/services/mailService.js | 6 +++--- server/services/monitoringService.js | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/services/mailService.js b/server/services/mailService.js index 06ffe15..531370f 100644 --- a/server/services/mailService.js +++ b/server/services/mailService.js @@ -202,7 +202,7 @@ angular.module('ffffng') }, sendPendingMails: function (callback) { - Logger.tag('mail', 'queue').info('Start sending pending mails...'); + Logger.tag('mail', 'queue').debug('Start sending pending mails...'); var startTime = moment(); @@ -211,7 +211,7 @@ angular.module('ffffng') return callback(err); } - Logger.tag('mail', 'queue').info('Sending next batch...'); + Logger.tag('mail', 'queue').debug('Sending next batch...'); findPendingMailsBefore(startTime, MAIL_QUEUE_DB_BATCH_SIZE, function (err, pendingMails) { if (err) { @@ -219,7 +219,7 @@ angular.module('ffffng') } if (_.isEmpty(pendingMails)) { - Logger.tag('mail', 'queue').info('Done sending pending mails.'); + Logger.tag('mail', 'queue').debug('Done sending pending mails.'); return callback(null); } diff --git a/server/services/monitoringService.js b/server/services/monitoringService.js index 12ed52e..03b6811 100644 --- a/server/services/monitoringService.js +++ b/server/services/monitoringService.js @@ -110,7 +110,7 @@ angular.module('ffffng') var isValidMac = Validator.forConstraint(Constraints.node.mac); function parseNodesJson(body, callback) { - Logger.tag('monitoring', 'information-retrieval').info('Parsing nodes.json...'); + Logger.tag('monitoring', 'information-retrieval').debug('Parsing nodes.json...'); function parseTimestamp(timestamp) { if (!_.isString(json.timestamp)) { @@ -197,14 +197,14 @@ angular.module('ffffng') } function sendMonitoringMailsBatched(name, mailType, findBatchFun, callback) { - Logger.tag('monitoring', 'mail-sending').info('Sending "%s" mails...', name); + Logger.tag('monitoring', 'mail-sending').debug('Sending "%s" mails...', name); var sendNextBatch = function (err) { if (err) { return callback(err); } - Logger.tag('monitoring', 'mail-sending').info('Sending next batch...'); + Logger.tag('monitoring', 'mail-sending').debug('Sending next batch...'); findBatchFun(function (err, nodeStates) { if (err) { @@ -212,7 +212,7 @@ angular.module('ffffng') } if (_.isEmpty(nodeStates)) { - Logger.tag('monitoring', 'mail-sending').info('Done sending "%s" mails.', name); + Logger.tag('monitoring', 'mail-sending').debug('Done sending "%s" mails.', name); return callback(null); } @@ -450,7 +450,7 @@ angular.module('ffffng') retrieveNodeInformation: function (callback) { var url = config.server.map.nodesJsonUrl; - Logger.tag('monitoring', 'information-retrieval').info('Retrieving nodes.json: %s', url); + Logger.tag('monitoring', 'information-retrieval').debug('Retrieving nodes.json: %s', url); request(url, function (err, response, body) { if (err) { return callback(err); @@ -471,7 +471,7 @@ angular.module('ffffng') if (previousImportTimestamp !== null && !data.importTimestamp.isAfter(previousImportTimestamp)) { Logger .tag('monitoring', 'information-retrieval') - .info( + .debug( 'No new data, skipping. Current timestamp: %s, previous timestamp: %s', data.importTimestamp.format(), previousImportTimestamp.format() @@ -523,7 +523,7 @@ angular.module('ffffng') }, sendMonitoringMails: function (callback) { - Logger.tag('monitoring', 'mail-sending').info('Sending monitoring mails...'); + Logger.tag('monitoring', 'mail-sending').debug('Sending monitoring mails...'); var startTime = moment(); @@ -570,7 +570,7 @@ angular.module('ffffng') var daysBeforeCleanup = 30; Logger .tag('monitoring', 'information-cleanup') - .info('Cleaning up node data not updated for %s days...', daysBeforeCleanup); + .debug('Cleaning up node data not updated for %s days...', daysBeforeCleanup); Database.run( 'DELETE FROM node_state WHERE modified_at < ?', [moment().subtract(daysBeforeCleanup, 'days').unix()], @@ -581,7 +581,7 @@ angular.module('ffffng') Logger .tag('monitoring', 'information-retrieval') - .info('Node data cleanup done.'); + .debug('Node data cleanup done.'); callback(); }