Sha256: 4c4a356f6ad5ed1a6658d00cc7fd8e0c3665377cf2245e8793625e87b3b00fdf

Contents?: true

Size: 779 Bytes

Versions: 17

Compression:

Stored size: 779 Bytes

Contents

"use strict";
var levels = require('../levels')
, log4js = require('../log4js');

function logLevelFilter (minLevelString, maxLevelString, appender) {
  var minLevel = levels.toLevel(minLevelString);
  var maxLevel = levels.toLevel(maxLevelString, levels.FATAL);
  return function(logEvent) {
      var eventLevel = logEvent.level;
      if (eventLevel.isGreaterThanOrEqualTo(minLevel) && eventLevel.isLessThanOrEqualTo(maxLevel)) {
      appender(logEvent);
    }
  };
}

function configure(config, options) {
  log4js.loadAppender(config.appender.type);
  var appender = log4js.appenderMakers[config.appender.type](config.appender, options);
  return logLevelFilter(config.level, config.maxLevel, appender);
}

exports.appender = logLevelFilter;
exports.configure = configure;

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/log4js/lib/appenders/logLevelFilter.js