winston.setLevels = function (levels) { utils.setLevels(winston, defaultLogger.levels, levels); defaultLogger.setLevels(levels); };
winston.hash = utils.hash; winston.clone = utils.clone; winston.longestElement = utils.longestElement; winston.config = require('winston/config'); winston.addColors = winston.config.addColors; winston.Logger = require('winston/logger').Logger; // // We create and expose a "defaultLogger" so that the programmer may do the // following without the need to create an instance of winston.Logger directly: // var winston = require('winston'); // winston.log('info', 'some message'); // winston.error('some error'); // var defaultLogger = new (winston.Logger)({ transports: [new (winston.transports.Console)()] }); utils.setLevels(winston, null, defaultLogger.levels); ['log', 'add', 'remove', 'profile', 'extend'].forEach(function (method) { winston[method] = function () { return defaultLogger[method].apply(defaultLogger, arguments); }; }); winston.setLevels = function (levels) { utils.setLevels(winston, defaultLogger.levels, levels); defaultLogger.setLevels(levels); }; // // Define emitErrs property for default logger //