Socket
Socket
Sign inDemoInstall

@alt-javascript/logger-darkly

Package Overview
Dependencies
11
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @alt-javascript/logger-darkly

An listener for updating the LoggerCategoryCache from a Launch Darkly variation


Version published
Maintainers
1
Created

Readme

Source

A Listener For Updating The LoggerCategoryCache From A Launch Darkly Variation

NPM
Language Badge Package Badge
release notes

Introduction

An "Arctor" implementation for listening for and updating the LoggerCategoryCache from a Launch Darkly variation in server-side node.js.

Usage

To use the module, follow the example in the included below file, which plays nicely with all the other @alt-javascript modules.

The Scanner, takes a LoggerCategoryCacheVariation which is injected with the global root context LoggerCategoryCache instance (each logger has a handle to it, though we could get it directly from global.boot.contexts.root.loggercategoryCache) that will act on flagged LaunchDarkly JSON config and replace the internal cache object within it's see(clearly) function.

const LaunchDarkly = require('launchdarkly-node-server-sdk');
const ScannerDarkly = require('@alt-javascript/scanner-darkly');
const {config} = require("@alt-javascript/config");
const {boot} = require("@alt-javascript/boot");
const {LoggerFactory} = require('@alt-javascript/logger');
boot({config});


const LoggerCategoryCacheVariation = require('@alt-javascript/scanner-darkly'); // this  uses booted logging config, so is required after boot().

const logger = LoggerFactory.getLogger('@alt-javascript/scanner-darkly/scan');
const ldlogger = LoggerFactory.getLogger('LaunchDarkly');
const SDK_KEY = config.get('scanner.darkly.sdk-key');
const scannerDarkly = new ScannerDarkly(
    new LoggerCategoryCacheVariation('logging-levels', {"key": "user@test.com"}, {"/":"error"},logger.cache),
    SDK_KEY,
    {logger: ldlogger});

scannerDarkly.init();
// ... later, on process exit.
scannerDarkly.destroy();

Keywords

FAQs

Last updated on 02 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc