lib/logger.js
function createDefaultLogger(options) {
	const ConsoleLogger = require('./console'),
		consoleLogger = new ConsoleLogger(options),
		config = _.mergeWith({
			name: 'logger',
			streams: [
				{
					level: options && options.level || 'trace',
					type: 'raw',
					stream: consoleLogger
				}
			]
		}, options, function (a, b) {
			return _.isArray(a) ? a.concat(b) : undefined;
		});

	consoleLogger.level = bunyan.resolveLevel(options && options.level || 'trace');

	// default is to add the problem logger
	if (!options || options.problemLogger || options.problemLogger === undefined) {
		const ProblemLogger = require('./problem');
		config.streams.push({
			level: 'trace',
			type: 'raw',
			stream: new ProblemLogger(options)
		});
	}

	const defaultLogger = bunyan.createLogger(config);
	/**
	 * Set log level
	 * Backward compatible with Arrow Cloud MVC framework
	 * @param {Object} nameOrNum log level in string or number
	 * @return {String}
	 */
	defaultLogger.setLevel = function (nameOrNum) {
		var level = 'trace';
		try {
			level = bunyan.resolveLevel(nameOrNum);
		} catch (e) {} // eslint-disable-line no-empty
		consoleLogger.level = level;
		return this.level(level);
	};
	return defaultLogger;
}
function createDefaultLogger(options) {
	const ConsoleLogger = require('./console'),
		consoleLogger = new ConsoleLogger(options),
		config = _.mergeWith({
			name: 'logger',
			streams: [
				{
					level: options && options.level || 'trace',
					type: 'raw',
					stream: consoleLogger
				}
			]
		}, options, function (a, b) {
			return _.isArray(a) ? a.concat(b) : undefined;
		});

	consoleLogger.level = bunyan.resolveLevel(options && options.level || 'trace');

	// default is to add the problem logger
	if (!options || options.problemLogger || options.problemLogger === undefined) {
		const ProblemLogger = require('./problem');
		config.streams.push({
			level: 'trace',
			type: 'raw',
			stream: new ProblemLogger(options)
		});
	}

	const defaultLogger = bunyan.createLogger(config);
	/**
	 * Set log level
	 * Backward compatible with Arrow Cloud MVC framework
	 * @param {Object} nameOrNum log level in string or number
	 * @return {String}
	 */
	defaultLogger.setLevel = function (nameOrNum) {
		var level = 'trace';
		try {
			level = bunyan.resolveLevel(nameOrNum);
		} catch (e) {} // eslint-disable-line no-empty
		consoleLogger.level = level;
		return this.level(level);
	};
	return defaultLogger;
}
function createDefaultLogger ( options ) { const ConsoleLogger = require ( './console' ) , consoleLogger = new ConsoleLogger ( options ) , config = _ . mergeWith ( { name : 'logger' , streams : [ { level : options && options . level || 'trace' , type : 'raw' , stream : consoleLogger } ] } , options , function ( a , b ) { return _ . isArray ( a ) ? a . concat ( b ) : undefined ; } ) ; consoleLogger . level = bunyan . resolveLevel ( options && options . level || 'trace' ) ; // default is to add the problem logger if ( ! options || options . problemLogger || options . problemLogger === undefined ) { const ProblemLogger = require ( './problem' ) ; config . streams . push ( { level : 'trace' , type : 'raw' , stream : new ProblemLogger ( options ) } ) ; } const defaultLogger = bunyan . createLogger ( config ) ; /**
	 * Set log level
	 * Backward compatible with Arrow Cloud MVC framework
	 * @param {Object} nameOrNum log level in string or number
	 * @return {String}
	 */ defaultLogger . setLevel = function ( nameOrNum ) { var level = 'trace' ; try { level = bunyan . resolveLevel ( nameOrNum ) ; } catch ( e ) { } // eslint-disable-line no-empty consoleLogger . level = level ; return this . level ( level ) ; } ; return defaultLogger ; }
Create a default logger

@param  {Object} options - options
@returns {Object}
Create a default logger