Closed xmedeko closed 3 years ago
Yes, that's correct! It's telling you the configured loglevel, not the level of the logger you're implementing (which would really just duplicate methodName
).
This argument is provided primarily really because it's needed for the internal method factory implementation that uses it as part of supporting older IE versions which was important when this API was created (more than 7 years ago now!). At this stage it'd be very difficult to change without breaking existing plugins, and I can imagine there might be cases where it's useful to know the overall loglevel like this anyway.
Is this causing you problems? You should be able to get the level for the current method as a number by combining methodName
and loglevel.LEVELS
I think.
If you think the documentation could be improved here, I'm open to PR to clarify that.
Yes, the current log level may be gotten from methodName
easily, it was just confusing for me. I will try to make doc PR.
When I set my own
loglevel.methodFactory
then the parameter has always same value - the min. number set bysetLevel
. E.g. https://jsfiddle.net/xmedeko/e9z1038x/9/ :The output shows
logLevel
param as 1, 1, 1. Is this behaviour ok?I would expect it to be 2, 3, 4 according to the
methodName
. So as I can do e.g.