winston-humanize-formatter
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Winston humanize formatter

Format winston logging in a human readable format

Install

npm install winston-humanize-formatter

Usage

You can either use the formatters directly or use one of the presets

import { transports, createLogger } from 'winston';
import { presets } from 'winston-humanize-formatter';
 
createLogger({
  level: 'debug',
  format: presets.cli.dev,
  transports: [
    new transports.Console()
  ]
});

available presets

import { presets } from 'winston-humanize-formatter';
 
presets.cli.dev;
presets.cli.prod;

available formatters

import { formatter } from 'winston-humanize-formatter';
 
formatter.colorize({ keys: string[] });
formatter.join({ keys: string[] });
formatter.multiline({ keys: string[] });
formatter.padLevels({ keys: string[] });
formatter.prettyJson({ excludeKeys: string[], colorize?: boolean, depth?: number });
formatter.stacks({ cleanStackPaths: boolean });

Examples

Preset cli dev CLI dev example

Package Sidebar

Install

npm i winston-humanize-formatter

Weekly Downloads

29

Version

0.1.4

License

MIT

Unpacked Size

73.3 kB

Total Files

57

Last publish

Collaborators

  • koenig-dominik