Format winston logging in a human readable format
npm install winston-humanize-formatter
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()
]
});
import { presets } from 'winston-humanize-formatter';
presets.cli.dev;
presets.cli.prod;
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 });