lib/core.js
function gatherErrors(level, exception, message, data, appenders) {
  var logAttributes = {},
    localAppenders = appenders || errorAppenders,
    errorAppender, attributeName, attributes, i, key;

  // Go over every log appender and add it's attributes so we can log them.
  for (i = 0; i < localAppenders.length; i++) {
    errorAppender = localAppenders[i];
    attributes = errorAppender(level, exception, message, data);

    for (key in attributes) {
      if (!attributes.hasOwnProperty(key)) {
        continue;
      }
      logAttributes[key] = attributes[key];
    }
  }

  return logAttributes;
}
function gatherErrors(level, exception, message, data, appenders) {
  var logAttributes = {},
    localAppenders = appenders || errorAppenders,
    errorAppender, attributeName, attributes, i, key;

  // Go over every log appender and add it's attributes so we can log them.
  for (i = 0; i < localAppenders.length; i++) {
    errorAppender = localAppenders[i];
    attributes = errorAppender(level, exception, message, data);

    for (key in attributes) {
      if (!attributes.hasOwnProperty(key)) {
        continue;
      }
      logAttributes[key] = attributes[key];
    }
  }

  return logAttributes;
}
function gatherErrors ( level , exception , message , data , appenders ) { var logAttributes = { } , localAppenders = appenders || errorAppenders , errorAppender , attributeName , attributes , i , key ; // Go over every log appender and add it's attributes so we can log them. for ( i = 0 ; i < localAppenders . length ; i ++ ) { errorAppender = localAppenders [ i ] ; attributes = errorAppender ( level , exception , message , data ) ; for ( key in attributes ) { if ( ! attributes . hasOwnProperty ( key ) ) { continue ; } logAttributes [ key ] = attributes [ key ] ; } } return logAttributes ; }
Used to gather the errors that have occurred.  This function loops over the existing
logAppenders and creates the attributes that will be logged to the errors. Returns
an object of errors to log.

@function gatherErrors
@private

@param {string} level      - Log level of the exception. (e.g. ERROR, FATAL)
@param {error}  exception  - JavaScript Error object.
@param {string} message    - Message of the error.
@param {object} data       - Key/Value pairing of additional properties to log.
@param {array} appenders   - If passed will override existing appenders and be used.
Used to gather the errors that have occurred . This function loops over the existing logAppenders and creates the attributes that will be logged to the errors . Returns an object of errors to log .