New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@madgex/datadog-logger

Package Overview
Dependencies
Maintainers
11
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@madgex/datadog-logger - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

23

__integration_tests__/integration.test.js
const DataDogLogger = require('../logger_setup');
it('Can log using TCP', async () => {
it('Can log using TCP', async done => {

@@ -10,3 +10,3 @@ expect.assertions(1);

dataDog : {
port: 5398,
port: 5301,
hostIp: '127.0.0.1'

@@ -26,7 +26,10 @@ }

logger.end();
expect(true).toEqual(true);
setTimeout(() => {
logger.end();
expect(true).toEqual(true);
done();
}, 3000);
});
it('Can log using UDP', async () => {
it('Can log using UDP', async done => {
expect.assertions(1);

@@ -38,3 +41,3 @@

udp: true,
port: 5399,
port: 5302,
hostIp: '127.0.0.1'

@@ -53,5 +56,9 @@ }

logger.info('ddog UDP test 7', options);
logger.end();
expect(true).toEqual(true);
setTimeout(() => {
logger.end();
expect(true).toEqual(true);
done();
}, 3000);
});
{
"name": "@madgex/datadog-logger",
"version": "1.1.1",
"version": "1.1.2",
"description": "Setup console and Hapi Good logger",

@@ -5,0 +5,0 @@ "main": "logger_setup.js",

@@ -32,2 +32,3 @@ const assert = require('assert');

this.entryBuffer = [];
this.udpClient = null;

@@ -60,19 +61,18 @@ if (this.options.enableInternalDebugging) {

const client = dgram.createSocket('udp4');
while (client && this.entryBuffer.length) {
if(!this.udpClient) {
this.udpClient = dgram.createSocket('udp4');
}
while (this.udpClient && this.entryBuffer.length) {
const message = this.entryBuffer.pop();
if (message) {
client.send(message, 0, message.length, this.options.port, this.options.host, (err, bytes) => {
this.udpClient.send(message, 0, message.length, this.options.port, this.options.host, function(err, bytes) {
if (err) {
client = null;
this.close();
this.internalDebug('writing to buffer', err);
this.entryBuffer.push(bytes);
}
}
});
}
}
if (client) {
client.close();
}
}

@@ -88,2 +88,9 @@

}
close() {
if(this.udpClient) {
this.udpClient.close();
this.udpClient = null;
}
}
};
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