actually, just take out request logging and demote other noisy stuff to debug
This commit is contained in:
parent
22fb9daaa8
commit
709b472ecc
2 changed files with 5 additions and 24 deletions
19
lib/app.js
19
lib/app.js
|
|
@ -1,32 +1,14 @@
|
|||
/*jshint globalstrict: true, white: false, unused:false */
|
||||
/*globals require, exports, console, module, process */
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var path = require('path');
|
||||
var express = require('express');
|
||||
var morgan = require('morgan');
|
||||
var fs = require('fs');
|
||||
var LamassuConfig = require('lamassu-config');
|
||||
var routes = require('./routes');
|
||||
var Trader = require('./trader');
|
||||
var PostgresqlInterface = require('./postgresql_interface');
|
||||
var POLL_RE = /^poll/;
|
||||
|
||||
module.exports = function (options) {
|
||||
var app = express();
|
||||
|
|
@ -68,7 +50,6 @@ module.exports = function (options) {
|
|||
return !POLL_RE.test(req.url);
|
||||
}
|
||||
|
||||
app.use(morgan({skip: suppressPollLog}));
|
||||
app.use(express.bodyParser());
|
||||
|
||||
if (!options.https) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ var Trader = module.exports = function (db) {
|
|||
this.db = db;
|
||||
this.rates = {};
|
||||
this.logger = new (winston.Logger)({
|
||||
transports: [new (winston.transports.Console)()]
|
||||
transports: [new (winston.transports.Console)({level: 'info'})]
|
||||
});
|
||||
|
||||
this._tradeQueue = [];
|
||||
|
|
@ -278,7 +278,7 @@ Trader.prototype.stopPolling = function () {
|
|||
Trader.prototype.pollBalance = function (callback) {
|
||||
var self = this;
|
||||
|
||||
self.logger.info('collecting balance');
|
||||
self.logger.debug('collecting balance');
|
||||
|
||||
async.parallel({
|
||||
transferBalance: self.transferExchange.balance.bind(self.transferExchange),
|
||||
|
|
@ -295,7 +295,7 @@ Trader.prototype.pollBalance = function (callback) {
|
|||
}
|
||||
|
||||
balance.timestamp = Date.now();
|
||||
self.logger.info('Balance update:', balance);
|
||||
self.logger.debug('Balance update:', balance);
|
||||
self.balance = balance;
|
||||
|
||||
return callback && callback(null, balance);
|
||||
|
|
@ -306,13 +306,13 @@ Trader.prototype.pollRate = function (callback) {
|
|||
var self = this;
|
||||
|
||||
var currency = self.config.exchanges.settings.currency;
|
||||
self.logger.info('polling for rate...');
|
||||
self.logger.debug('polling for rate...');
|
||||
self.tickerExchange.ticker(currency, function(err, rate) {
|
||||
if (err) {
|
||||
return callback && callback(err);
|
||||
}
|
||||
|
||||
self.logger.info('Rate update:', rate);
|
||||
self.logger.debug('Rate update:', rate);
|
||||
self.rates[currency] = {rate: rate, timestamp: new Date()};
|
||||
return callback && callback(null, self.rates[currency]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue