Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fluent-logger

Package Overview
Dependencies
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluent-logger - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

5

lib/index.js

@@ -25,9 +25,10 @@ 'use strict';

// delegate logger interfaces to default sender object
var methods = ['emit', 'end', 'addListener', 'on', 'once', 'removeListener', 'removeAllListeners'];
var methods = ['emit', 'end', 'addListener', 'on', 'once', 'removeListener', 'removeAllListeners', 'setMaxListeners', 'getMaxListeners'];
methods.forEach(function(attr, i){
module.exports[attr] = function(){
if( sender ){
sender[attr].apply(sender, Array.prototype.slice.call(arguments));
return sender[attr].apply(sender, Array.prototype.slice.call(arguments));
}
return undefined;
};
});

6

lib/log4js.js

@@ -34,7 +34,9 @@ 'use strict';

};
['addListener', 'on', 'once', 'removeListener', 'removeAllListeners'].forEach(function(attr, i){
['addListener', 'on', 'once', 'removeListener', 'removeAllListeners', 'setMaxListeners', 'getMaxListeners'].forEach(function(attr, i){
appender[attr] = function(){
logSender[attr].apply(logSender, Array.prototype.slice.call(arguments));
return logSender[attr].apply(logSender, Array.prototype.slice.call(arguments));
};
});
// For Node.js v0.12 or earlier
appender._eventEmitter = logSender._eventEmitter;
return appender;

@@ -41,0 +43,0 @@ }

@@ -50,5 +50,5 @@ 'use strict';

['addListener', 'on', 'once', 'removeListener', 'removeAllListeners'].forEach(function(attr, i){
['addListener', 'on', 'once', 'removeListener', 'removeAllListeners', 'setMaxListeners', 'getMaxListeners'].forEach(function(attr, i){
FluentSender.prototype[attr] = function(){
this._eventEmitter[attr].apply(this._eventEmitter, Array.prototype.slice.call(arguments));
return this._eventEmitter[attr].apply(this._eventEmitter, Array.prototype.slice.call(arguments));
};

@@ -55,0 +55,0 @@ });

{
"name": "fluent-logger",
"version": "0.4.2",
"version": "0.5.0",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -5,2 +5,3 @@ var expect = require('chai').expect;

var runServer = require('../lib/testHelper').runServer;
var EventEmitter = require('events').EventEmitter;

@@ -78,3 +79,17 @@ log4js.restoreConsole();

});
it('should set max listeners', function(done) {
var appender = log4jsSupport.appender('debug');
if (EventEmitter.prototype.getMaxListeners) {
expect(appender.getMaxListeners()).to.be.equal(10);
}
appender.setMaxListeners(100);
if (EventEmitter.prototype.getMaxListeners) {
expect(appender.getMaxListeners()).to.be.equal(100);
} else {
expect(appender._eventEmitter._maxListeners).to.be.equal(100);
}
done();
});
});
});

@@ -5,2 +5,3 @@ var expect = require('chai').expect;

var async = require('async');
var EventEmitter = require('events').EventEmitter;

@@ -257,2 +258,16 @@ describe("FluentSender", function(){

it('should set max listeners', function(done){
var s = new sender.FluentSender('debug');
if (EventEmitter.prototype.getMaxListeners) {
expect(s.getMaxListeners()).to.be.equal(10);
}
s.setMaxListeners(100);
if (EventEmitter.prototype.getMaxListeners) {
expect(s.getMaxListeners()).to.be.equal(100);
} else {
expect(s._eventEmitter._maxListeners).to.be.equal(100);
}
done();
});
// Internal behavior test.

@@ -259,0 +274,0 @@ it('should not flush queue if existing connection is unavailable.', function(done){

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc