From dc634b22e06a0a2f7e7e3813d88d4b45873b7e39 Mon Sep 17 00:00:00 2001 From: Basil Peace Date: Mon, 5 Aug 2019 20:21:54 +0300 Subject: [PATCH] fix: fix error logging from submodules ``` [winston] Attempt to write logs with no transports ``` --- cli.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli.js b/cli.js index a546f761..6578441b 100755 --- a/cli.js +++ b/cli.js @@ -12,7 +12,7 @@ var _ = require('lodash'); var fs = Promise.promisifyAll(require('fs')); var readdirp = require('readdirp'); var Ajv = require('ajv'); -var winston = require('winston'); +var logger = require('winston'); var Schema = require('./lib/schema'); var readSchemaFile = require('./lib/readSchemaFile'); @@ -56,14 +56,14 @@ var argv = require('optimist') const docs = _.fromPairs(_.toPairs(argv).filter(([ key, value ]) => { return key.startsWith('link-'); }).map(([ key, value ]) => { return [ key.substr(5), value ];})); const i18n = require('i18n'); -const logger = winston.createLogger({ +logger.configure({ level: 'info', - format: winston.format.combine( - winston.format.splat(), - winston.format.simple() + format: logger.format.combine( + logger.format.splat(), + logger.format.simple() ), transports: [ - new winston.transports.Console({}) + new logger.transports.Console({}) ] });