lib/logger.js
function getLoggerOptions() {
  'use strict';

  var defaultOptions = {
    logger: {
      level: 'info',
      silent: false,
      exitOnError: true,
      logFile: ''
    }
  };

  var loggerOptions = {};

  // get the project's options
  var projectOptions = getOptions.getProjectOptions();

  // merge project options with default options; project options take precedence
  var options = getOptions.mergeOptions(defaultOptions, projectOptions);

  // check if we're unit testing
  if (isTest()) {
    options.logger.level = 'warn';
  }

  // basic transports from options
  loggerOptions.transports = [
    new winston.transports.Console({
      level: options.logger.level,
      silent: options.logger.silent,
      colorize: true
    })
  ];

  // check if we should add a log file
  if (options.logger.logFile) {
    loggerOptions.transports.push(
      new winston.transports.File({
        filename: options.logger.logFile,
        level: options.logger.level
      })
    );
  }

  loggerOptions.exitOnError = options.logger.exitOnError;

  return loggerOptions;

}
function getLoggerOptions() {
  'use strict';

  var defaultOptions = {
    logger: {
      level: 'info',
      silent: false,
      exitOnError: true,
      logFile: ''
    }
  };

  var loggerOptions = {};

  // get the project's options
  var projectOptions = getOptions.getProjectOptions();

  // merge project options with default options; project options take precedence
  var options = getOptions.mergeOptions(defaultOptions, projectOptions);

  // check if we're unit testing
  if (isTest()) {
    options.logger.level = 'warn';
  }

  // basic transports from options
  loggerOptions.transports = [
    new winston.transports.Console({
      level: options.logger.level,
      silent: options.logger.silent,
      colorize: true
    })
  ];

  // check if we should add a log file
  if (options.logger.logFile) {
    loggerOptions.transports.push(
      new winston.transports.File({
        filename: options.logger.logFile,
        level: options.logger.level
      })
    );
  }

  loggerOptions.exitOnError = options.logger.exitOnError;

  return loggerOptions;

}
function getLoggerOptions ( ) { 'use strict' ; var defaultOptions = { logger : { level : 'info' , silent : false , exitOnError : true , logFile : '' } } ; var loggerOptions = { } ; // get the project's options var projectOptions = getOptions . getProjectOptions ( ) ; // merge project options with default options; project options take precedence var options = getOptions . mergeOptions ( defaultOptions , projectOptions ) ; // check if we're unit testing if ( isTest ( ) ) { options . logger . level = 'warn' ; } // basic transports from options loggerOptions . transports = [ new winston . transports . Console ( { level : options . logger . level , silent : options . logger . silent , colorize : true } ) ] ; // check if we should add a log file if ( options . logger . logFile ) { loggerOptions . transports . push ( new winston . transports . File ( { filename : options . logger . logFile , level : options . logger . level } ) ) ; } loggerOptions . exitOnError = options . logger . exitOnError ; return loggerOptions ; }
Get options for logging system. Checks project's options against defaults, and sets up Winston's transport requirements

@return {Object} Contains Winston-specific options for transports and exiting on errors.
Get options for logging system . Checks project s options against defaults and sets up Winston s transport requirements