Timing impact. Before (numbers from my Mac):
$ node tools/timechild.js
Time `log.child`:
- adding no fields: 0.01307ms per iteration
- adding one field: 0.01336ms per iteration
- adding two fields: 0.0134ms per iteration
- adding serializer and one field: 0.01839ms per iteration
- adding a (stderr) stream and one field: 0.01905ms per iteration
- [fast] adding no fields: 0.000821ms per iteration
- [fast] adding one field: 0.001067ms per iteration
- [fast] adding two fields: 0.00122ms per iteration
After:
$ node tools/timechild.js
Time `log.child`:
- adding no fields: 0.01243ms per iteration
- adding one field: 0.01345ms per iteration
- adding two fields: 0.01343ms per iteration
- adding serializer and one field: 0.01671ms per iteration
- adding a (stderr) stream and one field: 0.01915ms per iteration
- [fast] adding no fields: 0.001742ms per iteration
- [fast] adding one field: 0.00193ms per iteration
- [fast] adding two fields: 0.002388ms per iteration
I.e., not great, but still 5x faster for the "fast child" path.
serializers are inherited. Streams can't be removed as part of the child
creation. The child doesn't own the parent's streams (so can't close them).
- Clean up Logger creation. The goal here was to ensure `log.child` usage
is fast. TODO: measure that.
- Add `Logger.stdSerializers.err` serializer which is necessary to get good
Error object logging with node 0.6 (where core Error object properties
are non-enumerable).