code: function makeEvent(entry, hostname) {
    var errors = extractErrors(entry.meta);
    var event = {
      level: entry.level ? entry.level.toUpperCase() : 'NONE',
      time: new Date(
        entry.timestamp ? entry.timestamp() : Date.now()
      ).toISOString(),
      info: { },
      data: entry.meta || { },
      message: entry.message || ''
    };
  
    if (hostname) {
      event.info.host = hostname;
    }
  
    if (errors.length) {
      errors.forEach(function(e, i) {
        errors[i] = makeEventError(e);
      });
      event.info.errors = errors;
    }
  
    return event;
  }
docs: Given a log entry and an optional hostname the function generates and returns
  an ecs-logs event.
  
  @param {Object} entry A log entry, this is the type of objects received by
  formatters.
  
  @param {string} [hostname] An optional hostname to set on the event.
  
  @return {Object} An ecs-logs event generated from the arguments.