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

@opuscapita/logger

Package Overview
Dependencies
Maintainers
29
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opuscapita/logger - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

32

index.js

@@ -12,3 +12,7 @@ 'use strict'

let debugMode = false;
const loggerConfigFilename = 'logger.json';
const loggerConfigFilenames = [
process.env.LOGGER_CONFIG_FILE,
'etc/logger.json',
'logger.json'
];
const _defaultFormatOptions = {

@@ -402,3 +406,2 @@ // See https://nodejs.org/api/util.html#utilinspectobject-options

try {
_info.write('Loading logger config file...\n');
const data = fs.readFileSync(filename, 'utf8', 'r');

@@ -473,15 +476,24 @@ const cfgFile = JSON.parse(data);

catch (e) {
_error.write(`Cannot parse logger config file: ${e.message}\n`);
return false;
switch (e.code) {
case 'ENOENT':
break;
default:
_error.write(`Cannot parse logger config file: ${e.message}\n`);
}
return false;
}
};
if (loadConfigFile(loggerConfigFilename)) {
for (const idx in loggerConfigFilenames) {
const loggerConfigFilename = loggerConfigFilenames[idx];
if (loggerConfigFilename && loadConfigFile(loggerConfigFilename)) {
_info.write(`Logger config file loaded (${loggerConfigFilename}), monitoring for changes\n`);
fs.watch(
loggerConfigFilename,
{persistent: false, recursive: false, encoding: 'utf8'/*, signal: abortController*/},
(event, filename) => {
_info.write(`Logger config change detected ${event}\n`);
loadConfigFile(filename);
loggerConfigFilename,
{persistent: false, recursive: false, encoding: 'utf8'/*, signal: abortController*/},
(event, filename) => {
_info.write(`Logger config change detected ${event}\n`);
loadConfigFile(filename);
});
};
};
{
"name": "@opuscapita/logger",
"version": "1.5.0",
"version": "1.6.0",
"description": "Unified logging component for OpusCapita Andariel platform.",

@@ -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