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

logginator

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logginator - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

19

index.js

@@ -37,3 +37,10 @@ var fs = require('fs');

var LINUX_LOG = "/dev/log", BSD_LOG = "/var/run/log";
var knownLogTargets = [
"/dev/log", // Linux
"/var/run/syslog", // OS X
"/var/run/log" // BSD
];
function isValidTarget(name) {
return fs.existsSync(name) && fs.statSync(name).isSocket();
}

@@ -44,5 +51,9 @@ options.protocol = spec.protocol || "unix";

if (!options.path) {
if (fs.statSync(LINUX_LOG).isSocket()) options.path = LINUX_LOG;
else if (fs.statSync(BSD_LOG).isSocket()) options.path = BSD_LOG;
else {
for (var i = 0; i < knownLogTargets.length; ++i) {
if (isValidTarget(knownLogTargets[i])) {
options.path = knownLogTargets[i];
break;
}
}
if (!options.path) {
throw new Error("Failed to find log socket path, and no such " +

@@ -49,0 +60,0 @@ "path was configured in \"path\" for the syslog logger backend");

{
"name": "logginator",
"version": "1.1.3",
"version": "1.1.4",
"description": "Creates an instance of TaggedLogger",

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

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