### function errorLogger(options) #### @options {Object} options to initialize the middleware.
169011
function errorLogger(options) {

    ensureValidOptions(options);

    options.requestFilter = options.requestFilter || defaultRequestFilter;
    options.winstonInstance = options.winstonInstance || (new winston.Logger ({ transports: options.transports }));

    return function (err, req, res, next) {

        // Let winston gather all the error data.
        var exceptionMeta = winston.exception.getAllInfo(err);
        exceptionMeta.req = filterObject(req, requestWhitelist, options.requestFilter);

        // This is fire and forget, we don't want logging to hold up the request so don't wait for the callback
        options.winstonInstance.log('error', 'middlewareError', exceptionMeta);

        next(err);
    };
}
313654
function initHandlers(options, handlerClass) {
    var optHandlers = Array.isArray(options[handlerClass]) ?
          options[handlerClass] : [options[handlerClass]],
      handlers = [];
    optHandlers.forEach(function(handler) {
      if (typeof handler === 'function') {
        handlers.push(handler);
      } else if (typeof handler === 'string' && builtinHandler[handlerClass][handler]) {
        handlers.push(builtinHandler[handlerClass][handler]);
      }
    });
    return handlers;
  }
987156
function(errMsg, err) {
      this.newline();
      doLog('*******************************************************************');
      doLog('* ERROR                                                           *');
      doLog('*******************************************************************');

      if (generalUtils.isEmpty(err)) {
        doLog(errMsg);
      } else {
        doLogError(errMsg, err);
      }
      this.newline();
    }
870087
function  (options, status) {
  this.name = ''
  this.error = options.error || 'invalid_request'
  this.error_description = options.error_description
  this.redirect_uri = options.redirect_uri
  this.statusCode = options.statusCode || 400
}
593294
function Logger(options) {
        var logger;

        // Default values
        var dict = {
            ssl: true,
            catchall: false,
            trace: true,
            page_info: 'never',
            print: false,
            endpoint: null,
            token: null
        };

        if (typeof options === "object")
            for (var k in options)
                dict[k] = options[k];
        else
            throw new Error("Invalid parameters for createLogStream()");

        if (dict.token === null) {
            throw new Error("Token not present.");
        } else {
            logger = new LogStream(dict);
        }

        var _log = function(msg) {
            if (logger) {
                return logger.log.apply(this, arguments);
            } else
                throw new Error("You must call LE.init(...) first.");
        };

         // The public interface
        return {
            log: function() {
                _log.apply(this, arguments).level('LOG').send();
            },
            warn: function() {
                _log.apply(this, arguments).level('WARN').send();
            },
            error: function() {
                _log.apply(this, arguments).level('ERROR').send();
            },
            info: function() {
                _log.apply(this, arguments).level('INFO').send();
            }
        };
    }
852040
function logQueryError (dbQueryId, options, err) {
    // require log client
    if (!this.logClient) {
        return
    }
    // do not log if query options flag is false
    if (options.log === false) {
        return
    }
    // log error
    this.logClient.log('dbResponse', {
        data: {
            code: err.code,
            isOperational: err.isOperational,
            message: err.message,
        },
        dbQueryId: dbQueryId.id,
        dbResponseSuccess: false,
        dbResponseCreateTime: microTimestamp(),
    })
}
1046191
function createErrorHandler(opts, transform) {
  return err => {
    if ('emit' === opts.error) {
      transform.emit('error', err)
    }
    else if ('function' === typeof opts.error) {
      opts.error(err)
    }
    else {
      const message = colors.red(err.name) + '\n' + err.toString()
        .replace(/(ParseError.*)/, colors.red('$1'))
      log(message)
    }

    transform.emit('end')

    if (opts.callback) {
      opts.callback(through2())
    }
  }
}
217519
function logError(terminal: Terminal, format: string, ...args: Array<mixed>): void {
  const str = util.format(format, ...args);
  terminal.log('%s: %s', chalk.red('error'), str);
}
581424
function constructor(options, error, name) {
    Pagelet.prototype.constructor.call(this, options);

    if (name) this.name = name;
    this.data = error instanceof Error ? error : {};
  }
73603
function _errorHandlers() {
  // middleware with an arity of 4 are considered
  // error handling middleware. When you next(err)
  // it will be passed through the defined middleware
  // in order, but ONLY those with an arity of 4, ignoring
  // regular middleware.
  app.use(function(err, req, res, next){
    logger.error(err);
    console.trace();
    if(req.accepts('html') || req.is('html')) {
      res.status(err.status || 500);
      res.render('500', { error: err });
      return;
    }
    res.send(err.status || 500, { error: err.message });
  });

  // our custom JSON 404 middleware. Since it's placed last
  // it will be the last middleware called, if all others
  // invoke next() and do not respond.
  app.use(function(req, res) {
    logger.error('Failed to locate:'+req.url);
    console.trace();
    if(req.accepts('html') || req.is('html')) {
      res.status(404);
      res.render('404', { url: req.url });
      return;
    }
    res.send(404, { error: "can't find the resource" });
  });
}
373773
function NameError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'Middleware Name Error';
  this.message = message || 'The argument must be a named function or supply a name';
}
545806
function createErrorHandler(yargs) {
	if (!yargs) {
		yargs = Yargs;
	}
	return consoleErrorLogger.bind(undefined, console, yargs, true);
}
823419
function (errors, options) {
                if (options.fields && options.fields.length) {
                    var field;
                    for (var j = 0; j < options.fields.length; j++) {
                        field = options.fields[j];
                        this.$errors.unset(field);
                    }
                } else {
                    this.$errors.clear();
                }


                var error;
                try {
                    for (var i = 0; i < errors.length; i++) {
                        error = errors[i];
                        if (error.$.field && !this.$errors.$.hasOwnProperty(error.$.field)) {
                            this.$errors.set(error.$.field, error);
                        } else if (!this.$errors.$.hasOwnProperty('_base')) {
                            this.$errors.set('_base', error);
                        }
                    }
                } catch (e) {
                    this.log(e, 'warn');
                }
                this.trigger('isValidChanged');
            }
1354740
function ConsoleLogger() {

    this.error = function () {
        if (loggingLevel(ERROR)) {
            console.error.apply(this, arguments);
        }
    };

    this.warn = function () {
        if (loggingLevel(WARN)) {
            console.warn.apply(this, arguments);
        }
    };

    this.info = function () {
        if (loggingLevel(INFO)) {
            console.info.apply(this, arguments);
        }
    };

    this.log = function () {
        if (loggingLevel(INFO)) {
            console.log.apply(this, arguments);
        }
    };

    this.debug = function () {
        if (loggingLevel(DEBUG)) {
            console.log.apply(this, arguments);
        }
    };

    this.setLevelToInfo = function () {
        setLevel(INFO);
    };

    this.setLevelToDebug = function() {
        setLevel(DEBUG);
    };

    this.setLevelToWarning = function() {
        setLevel(WARN);
    };

    this.setLevelToError = function() {
        setLevel(ERROR);
    };
}
746344
function(options) {
      options = options || {};

      this.validateRunOptions(options);

      if (_.has(options, 'log') && this.logger.level && this.logger.level.toString() != options.log.toUpperCase()) {
        this.logger.setLevel(options.log.toUpperCase());
      }
    }
888749
def init_logger
      log = Log4r::Logger.new(STANDARD_LOGGER)
      log.trunc = true

      # sanity checks since we defined log4r's dynamic levels statically
      unless (Log4r::DEBUG == DEBUG) &&
             (Log4r::INFO == INFO) &&
             (Log4r::WARN == WARN) &&
             (Log4r::ERROR == ERROR) &&
             (Log4r::FATAL == FATAL)
        raise "Logger levels do not match Log4r levels, levels may have been customized"
      end

      Log4r::Logger[STANDARD_LOGGER].level = WARN
      Log4r::Logger[STANDARD_LOGGER].trace = true

      Log4r::StderrOutputter.new :console
      Log4r::Outputter[:console].formatter = Log4r::PatternFormatter.new(:pattern => "[%l] %m")
      log.add(:console)
    end
945377
function handleError(error) {
	console.log(`${options.entry} failed.`);
	console.trace(error);

	setTimeout(() => {
		throw error;
	});
}