1.0.0 • Published 6 years ago

@roarr/middleware-serialize-error v1.0.0

Weekly downloads
203
License
-
Repository
github
Last release
6 years ago

@roarr/middleware-serialize-error

Travis build status Coveralls NPM version Canonical Code Style Twitter Follow

Serializes error objects in the Roarr message context.

Behaviour

The current implementation maps only the direct context properties.

Raise an issue if you have a use case that requires deep property mapping.

Usage

import log from 'roarr';
import createSerializeErrorMiddleware from '@roarr/middleware-serialize-error';

const childLog = log.child(createSerializeErrorMiddleware());

const error = new Error('foo');

log.debug({error}, 'bar');
childLog.debug({error}, 'bar');