{"size": 829, "ext": "js", "max_stars_repo_path": "server/controllers/app/logging.js", "max_stars_repo_name": "n8io/n8ioffl", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/controllers/app/logging.js", "max_issues_repo_name": "n8io/n8ioffl", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/controllers/app/logging.js", "max_forks_repo_name": "n8io/n8ioffl", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.90625, "max_line_length": 80, "alphanum_fraction": 0.6393244873}
logger = null;
var bunyan = require('bunyan');
var Bunyan2Loggly = require('bunyan-loggly').Bunyan2Loggly;
module.exports = function(){
  var streams = [];

  if(config.get('logging:console:enabled')){
    streams.push({
      level: config.get('logging:console:level') || 'info',
      stream: process.stdout
    });
  }

  if(config.get('logging:file:enabled')){
    streams.push(_.omit(config.get('logging:file'), 'enabled'));
  }

  if(config.get('logging:loggly:enabled')){
    streams.push({
      type: 'raw',
      stream: new Bunyan2Loggly(_.omit(config.get('logging:loggly'), 'enabled'))
    });
  }

  logger = bunyan.createLogger({
    name: config.get('app:name') || 'log name is not set!',
    streams: streams,
    serializers: bunyan.stdSerializers
  });

  logger.log = logger.info; // Monkey-patch logger.log
};