diff --git a/lib/logger.js b/lib/logger.js index 8312b5e2..29556e81 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,10 +1,15 @@ const winston = require('winston') const options = require('./options') +const _ = require('lodash') const logger = new winston.Logger({ level: options.logLevel, transports: [ - new (winston.transports.Console)({timestamp: true, colorize: true}) + new (winston.transports.Console)({ timestamp: true, colorize: true }) + ], + rewriters: [ + (...[,, meta]) => _.hasIn('toString', meta) + ? meta.toString() : 'Error, no further information is available' ] })