Open
Description
I read that you guys are thinking of a version 2.0 for morgan on one of the other issues..
I didn't see a 2.0 branch so I wasn't sure what your plans are, but I was wondering if you would be implementing the ES6 Symbol technique as to not conflict with any other express middleware that could be trying to store _startTime and such on req/res.
So some something like
const START_TIME = Symbol("startTime");
const START_AT = Symbol("startAt");
const REMOTE_ADDRESS = Symbol("remoteAddress");
....
function recordStartTime() {
this[START_AT] = process.hrtime()
this[START_TIME] = new Date()
}
...
// And expose the Symbols incase other modules may want to hook into morgan
module.exports.START_TIME = START_TIME;
module.exports.START_AT = START_TIME;
module.exports.REMOTE_ADDRESS = REMOTE_ADDRESS;
- Colin