visionmedia/jog — pull request #15 by cpsubrian (2012-10-24 00:11:34+00:00)
Title: Replace named tokens in 'attrs.type'.

For example:

```js
server.on('request', function (req, res) {
var orig = res.end;
res.end = function() {
log.info('Request - :req.method :req.url (:status)', {
req: {
method: req.method,
url: req.url,
status: res.statusCode,
// .. other req junk you want to log
}
});
orig.apply(res, arguments);
});
});
```

Might result in:

```
{type: 'Request - GET /foo.html (200)', timestamp: 123456789, req: { ... }}
```

Why do I want this?

(Pending the merge of the StdStore), I'd like to be able to 'watch' the logs in realtime only looking at the types, but later on I can look at the logs using jog's CLI with all the filtration options and whatnot.

This would allow dynamic types based on the other data without having to do any string formatting in your app code.

FYI this supports nested tokens such as `:name.first`, but does not currently support diving into Arrays at all.