Can't provide custom logger and configure log level without warnings #1040
Labels
bug
M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
good first issue
Good for newcomers
Milestone
Description
As someone with an existing logger, I want to be able to be able to use Bolt to log with my existing Logger instance, and also control the log level.
Assuming I have implemented the
Logger
interface (fully, includingsetLevel()
/getLevel()
), and I'm passing my implementation into theApp
as thelogger
option, then there is no way I can see to set the initial log level on the custom logger in this situation:logLevel
option to theApp
, as well. This should work, but gives a big warning:bolt-js/src/App.ts
Line 257 in 08b50ca
setLevel
on whatever logger you passed it, here, overwriting whatever value it had:bolt-js/src/App.ts
Line 239 in 08b50ca
logLevel
!:bolt-js/src/App.ts
Line 227 in 08b50ca
At the moment, this means passing
logLevel
andlogger
provides the correct behavior, but gives several warnings. On the other hand, passing justlogger
means you'd have to wait until the App is initialized, then re-callsetLevel
on it yourself, to rewrite what the App just did to it on initialization...I think it's most likely that the warning given in (1) is incorrect, and can be removed.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)The text was updated successfully, but these errors were encountered: