Allow log.child(...)
to work even if the logger is a *sub-class* of Bunyan's Logger class.
This commit is contained in:
parent
a7c646191d
commit
c25ce3a5bd
2 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,8 @@ Known issues:
|
|||
|
||||
## bunyan 1.3.4 (not yet released)
|
||||
|
||||
- Allow `log.child(...)` to work even if the logger is a *sub-class*
|
||||
of Bunyan's Logger class.
|
||||
- [issue #219] Hide 'source-map-support' require from browserify.
|
||||
- [issue #218] Reset `haveNonRawStreams` on `<logger>.addStream`.
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@ Logger.prototype.addSerializers = function addSerializers(serializers) {
|
|||
* creation. See 'tools/timechild.js' for numbers.
|
||||
*/
|
||||
Logger.prototype.child = function (options, simple) {
|
||||
return new Logger(this, options || {}, simple);
|
||||
return new (this.constructor)(this, options || {}, simple);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue