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

gracelog

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gracelog - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

6

CHANGELOG.md

@@ -11,5 +11,9 @@ # Change log

#### Bug Fix: remote logging now supports cluster.
Refer to github commit log: https://github.com/voltrue2/gracelog/commit/3280a91e71ac292b3887c3a0b564b776278aa78a
#### Bug Fix: remote logging was broken
Refer to github commit log:7bd47c92d1afb332869c7ae3f72d1656e6971ccf
Refer to github commit log: https://github.com/voltrue2/gracelog/commit/549bf4113170f18fd68d6a0c1515472e758a16ac

@@ -16,0 +20,0 @@ ## Deprecated

47

lib/remote.js

@@ -0,1 +1,2 @@

var async = require('async');
var dgram = require('dgram');

@@ -5,5 +6,6 @@

var address = null;
var config = null;
var client;
module.exports.setup = function (configIn) {

@@ -16,35 +18,20 @@

address = ip.get();
if (!configIn.port || !configIn.host) {
console.error('Error: missing remoteServer configurations');
console.error(configIn);
return;
}
config = configIn;
client = dgram.createSocket('udp4');
};
// cb is optional for auto buffer flushing
module.exports.log = function (levelName, msg, cb) {
// check config
if (!config || !config.port || !config.host) {
console.error('Error: missing remoteServer configurations');
console.error(config);
return;
}
var data = {
address: address,
name: levelName,
message: msg,
};
data = new Buffer(JSON.stringify(data));
// set up UDP sender
var client = dgram.createSocket('udp4');
var offset = 0;
// send
client.send(data, offset, data.length, config.port, config.host, function (error) {
if (error) {
console.error(error);
}
// close socket
client.close();
if (cb) {
cb();
}
});
module.exports.log = function (levelName, msgData, cb) {
async.forEach(msgData, function (item, next) {
client.send(item.msg, 0, item.msg.length, config.port, config.host, next);
}, cb || function () {});
};
{
"name": "gracelog",
"description": "Log management module",
"version": "0.5.2",
"version": "0.5.3",
"author": "Nobuyori Takahashi <voltrue2@yahoo.com>",

@@ -6,0 +6,0 @@ "repository": {

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