0.0.2 • Published 7 years ago

reslog v0.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

reslog

Adds a function and an array to the express response object: log() and _log.

Build up the _log array by calling res.log() with a description and whatever objects to log, Ex:

res.log('User object', res.locals.session.user)
res.log('Session expires', res.locals.session.expires)

then call

res.log() 

with no arguments to return an object { 'reslog' : (_log array as a formatted JSON string) } which can then be passed into a view

res.render('view', res.log())

Put {{ reslog }} in the view, like below the footer