mozilla/picl-idp — pull request #168 by dannycoates (2013-08-29 00:43:48+00:00)
Title: Enhanced logging experience

This patch uses the power of domains to stamp the request id onto all trace log lines. This allows us to distinguish an individual request when there are multiple simultaneous requests in progress. As a bonus, in a dev environment the trace log will be added to any error responses.

The guidelines for logging are:

```js
// prefer one trace at the start of the function
// many log lines in a function may indicate you should consider refactoring
log.trace( // prefer trace over other levels
{ // prefer a single object argument
op: 'Moduleish.functionish', // a unique grep-able name, see existing code for examples
p1: 1, // any number of context helping parameters, prefer arguments and ids, fewer is better
p2: false // prefer short names and primitive values, i.e. not Objects, Arrays, Buffers
}
)
```