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

@beforeyoubid/console-logger-adapter

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beforeyoubid/console-logger-adapter - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

18

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Logger = require('logdna');
const winston = require('winston');
const { LOG_LEVEL = 'info', LOGDNA_KEY = '', STAGE = 'n/a', AWS_LAMBDA_FUNCTION_NAME = 'n/a' } = process.env;
let initialised = false;
let logger;
const options = {

@@ -28,9 +31,10 @@ key: LOGDNA_KEY,

const sendConsoleLogsToLogDNA = (suppliedLogDNAKey = LOGDNA_KEY, sending = true) => {
if (process.env.HAS_INITIALISED_LOGDNA === 'initialised')
return null;
process.env.HAS_INITIALISED_LOGDNA = 'initialised';
// If suppliedLogDNAKey is not available don't need to activate
if (!suppliedLogDNAKey)
return null;
const logger = sending ? Logger.setupDefaultLogger(LOGDNA_KEY, options) : getFakeLogger();
return winston.createLogger({ level: LOG_LEVEL });
// If we call multiple times, just return the logger and don't wrap it again
if (initialised)
return logger;
console.debug('--------------------- Initialising Logger -----------------------');
initialised = true;
logger = sending ? Logger.setupDefaultLogger(LOGDNA_KEY, options) : getFakeLogger();
const _log = console.log;

@@ -65,4 +69,4 @@ const _info = console.info;

console.error = error;
return null;
return logger;
};
exports.default = sendConsoleLogsToLogDNA;
{
"name": "@beforeyoubid/console-logger-adapter",
"version": "1.0.2",
"version": "1.0.3",
"description": "A wrapper module to wrap console.xxx() and send all logs to LogDNA",

@@ -30,3 +30,4 @@ "main": "dist/index.js",

"dependencies": {
"logdna": "^3.5.1"
"logdna": "^3.5.1",
"winston": "^3.3.3"
},

@@ -33,0 +34,0 @@ "devDependencies": {

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