Skip to content
This repository has been archived by the owner on Jan 20, 2018. It is now read-only.

An improved error serializer that not only logs the error type, message and stack but also other properties set on the error object

License

Notifications You must be signed in to change notification settings

IndigoUnited/pino-err-serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pino-err-serializer

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status

NOTE: This module is deprecated because it has been merged into pino!

An improved error serializer for pino that not only logs the error type, message and stack but also other properties set on the error object.

Installation

$ npm install pino-err-serializer

Usage

const pino = require('pino');
const errSerializer = require('pino-err-serializer');

const logger = pino({
    serializers: {
        err: errSerializer,
    },
});

logger.info({
    err: Object.assign(new Error('Some error'), { this: 'will be serialized' })
}, 'An error occurred!');

Tests

$ npm test
$ npm test-cov to get coverage report

License

Released under the MIT License.

About

An improved error serializer that not only logs the error type, message and stack but also other properties set on the error object

Resources

License

Stars

Watchers

Forks

Packages

No packages published