winston-verror-format
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Winston@3 verror format

Version npm npm Downloads Dependencies Build Status Codecov Known Vulnerabilities

Winston@3 verror full stack trace, with all nested errors recursively reported as caused by: + err.stack.

Install

npm install winston-verror-format

Usage TypeScript

import { createLogger, format, transports } from "winston";
import { verrorFormat } from "winston-verror-format";
import VError from "verror";
 
const logger = createLogger({
  format: format.combine(verrorFormat({ stack: true }), format.json()),
  transports: [new transports.Console()],
});
 
logger.error(new VError(new Error("Error #1"), "Unexpected error"));

Usage JavaScript

const { createLogger, format, transports } = require("winston");
const { verrorFormat } = require("winston-verror-format");
const VError = require("verror");
 
const logger = createLogger({
  format: format.combine(verrorFormat({ stack: true }), format.json()),
  transports: [new transports.Console()],
});
 
logger.error(new VError(new Error("Error #1"), "Unexpected error"));

API

verrorFormat(options)

options

Configuration object.

Type: VErrorFormatOptions

options.stack

Save full stack trace as meta stack.

Type: boolean
Default: false

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.36latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.36
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i winston-verror-format

Weekly Downloads

6

Version

1.0.3

License

MIT

Unpacked Size

8.67 kB

Total Files

7

Last publish

Collaborators

  • armiento