Closed shaharke closed 8 years ago
@adambiggs I'm merging this PR since this really is a big bug.
@shaharke sounds good. Sorry for introducing this bug!
Trying to understand how I broke it... I'm guessing this.level
here wasn't the same variable as here? So after I changed it to this.options.level
it was the same variable which caused the bug?
It looks like || this.options.level
on line 62 isn't needed anymore then?
@adambiggs you removed the this.level
assignment in the constructor, which meant that the parent transport logic of filtering messages by level was not working.
And yes - || this.options.level
on line 62 is redundant. I'll remove it.
Ah, that makes sense.
Fixes #31: Sometimes I'm baffled by inheritance in JavaScript...
Before 0.1.2 the level was extracted from
options
and was set onthis
:This was omitted in the latest release. I think that it's best to call the constructor of
winston.Transport
with the relevant options instead of setting those options onthis
. IMO it makes it clearer that those properties are intended for the parent class and not for the child.@adambiggs WDYT?