Fix logger clutter message (#201)
* Fix logger message handling * Fix standard styling issues
This commit is contained in:
parent
de8a380bd8
commit
65ce8aee3d
2 changed files with 7 additions and 10 deletions
|
|
@ -30,8 +30,6 @@ function mapCoin (info, deviceId, cryptoCode) {
|
|||
const cashInRate = showRates ? _.invoke('cashIn.toNumber', rates) : null
|
||||
const cashOutRate = showRates ? _.invoke('cashOut.toNumber', rates) : null
|
||||
|
||||
|
||||
|
||||
return {
|
||||
cryptoCode,
|
||||
cashInFee,
|
||||
|
|
@ -151,7 +149,7 @@ function update (info) {
|
|||
|
||||
return mapRecord(info)
|
||||
.then(sendRadar)
|
||||
.catch(err => logger.error(err))
|
||||
.catch(err => logger.error(`Failure to update CoinATMRadar`, err))
|
||||
}
|
||||
|
||||
function computeOperatorId (masterSeed) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
const winston = require('winston')
|
||||
const options = require('./options')
|
||||
const _ = require('lodash')
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const logger = new winston.Logger({
|
||||
level: options.logLevel,
|
||||
|
|
@ -8,8 +8,7 @@ const logger = new winston.Logger({
|
|||
new (winston.transports.Console)({ timestamp: true, colorize: true })
|
||||
],
|
||||
rewriters: [
|
||||
(...[,, meta]) => _.hasIn('toString', meta)
|
||||
? meta.toString() : 'Error, no further information is available'
|
||||
(...[,, meta]) => meta instanceof Error ? { message: meta.message, stack: meta.stack } : meta
|
||||
]
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue