lib/index.js
function Logger(options) {
  if (!options) {
    options = { };
  }

  if (typeof options.level === 'undefined') {
    options.level = 'debug';
  }

  if (!options.transports) {
    options.transports = [new Transport(options)];
    delete options.name;
    delete options.hostname;
    delete options.timestamp;
    delete options.formatter;
  }

  Logger.super_.call(this, options);
  this.setLevels(options.levels || Levels);
}
function Logger(options) {
  if (!options) {
    options = { };
  }

  if (typeof options.level === 'undefined') {
    options.level = 'debug';
  }

  if (!options.transports) {
    options.transports = [new Transport(options)];
    delete options.name;
    delete options.hostname;
    delete options.timestamp;
    delete options.formatter;
  }

  Logger.super_.call(this, options);
  this.setLevels(options.levels || Levels);
}
function Logger ( options ) { if ( ! options ) { options = { } ; } if ( typeof options . level === 'undefined' ) { options . level = 'debug' ; } if ( ! options . transports ) { options . transports = [ new Transport ( options ) ] ; delete options . name ; delete options . hostname ; delete options . timestamp ; delete options . formatter ; } Logger . super_ . call ( this , options ) ; this . setLevels ( options . levels || Levels ) ; }
The Logger type is a winston logger with preconfigured defaults to output
log messages compatible with ecs-logs.

@example
var ecslogs = require('ecs-logs-js');

var log = new ecslogs.Logger({
level: 'info'
});

log.info('Hi there!');

@param {Object} [options] The configuration object for the new logger,
besides the properties documented here the options object can also carry all
properties that the Transport and Formatter constructors accept, they will be
passed to the default transport and formatter instantiated if none was given.

@param {string} [level] The minimum level for log messages this logger will
pass to its transports, defaults to 'debug'

@param {transports} [Object[]] An array of winston transports that the logger
will be passing log messages to, defaults to a single instance of Transport.
The Logger type is a winston logger with preconfigured defaults to output log messages compatible with ecs - logs .