🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@redpill-paris/winston-limit-transport

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redpill-paris/winston-limit-transport

package limiting the duplication of logs

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
3
Created
Source

winston-limit-transport

A logger transport for winston limiting same messages in logs. Reducing your cost and readability in your loggers.

Install

yarn add @redpill-paris/winston-limit-transport

Configuration

const winston = require('winston');
const WinstonLimit = require('@redpill-paris/winston-limit-transport');

const logger = winston.createLogger({
  level: 'debug',
  transports: [
    new WinstonLimit({
      timeout: 500, // time between two same logs
      transport: new winston.transports.Console({
        handleExceptions: true,
      }), // transport to be used if the log is not limited
    }),
  ],
});

logger.info('Logger init finish');

TODO

  • Include metadata in the hash of the limiter(Only the message is compared to previous logs)
  • Emit to a stream when a log is limited

Keywords

limit

FAQs

Package last updated on 10 May 2020

Did you know?

Socket

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