Socket
Socket
Sign inDemoInstall

@redpill-paris/winston-limit-transport

Package Overview
Dependencies
14
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redpill-paris/winston-limit-transport

package limiting the duplication of logs


Version published
Maintainers
3
Weekly downloads
103
increased by221.88%
Install size
638 kB

Weekly downloads

Readme

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

FAQs

Last updated on 10 May 2020

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