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

@collectivehealth/winston-multi-line-console-transport

Package Overview
Dependencies
Maintainers
45
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collectivehealth/winston-multi-line-console-transport

A console transport for Winston that elegantly handles multi-line log messages.

  • 2.0.2
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
45
Weekly downloads
 
Created
Source

Winston Multi-Line Console Transport

Let's say we wanted to log something like this to Winston:

logger.debug('This is a multi-line:\nlog message.');

By default, we would get output like this:

debug: This is a multi-line:
log message.

Lines 2-N will not be aligned correctly, making things harder to read. This can be especially obnoxious when logging stack traces or serialized JSON structures.

Using this package instead of the built-in Console transport gives you output like this:

debug: This is a multi-line:
debug: log message.

Install

Note: This package requires Winston 3.x.

$ npm i @collectivehealth/winston-multi-line-console-transport

Use

import winston from 'winston';
import MultiLineConsoleTransport from '@collectivehealth/winston-multi-line-console-transport';


const logger = winston.createLogger({
  // Logger options.
});


logger.add(new MultiLineConsoleTransport({
  level: 'debug'
  format: winston.format.combine(
    winston.format.prettyPrint(),
    winston.format.colorize(),
    winston.format.simple()
  )
}));

FAQs

Package last updated on 12 Jul 2018

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

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