Closed vladak closed 1 year ago
Sounds like a good improvement to readability!
Do you want to submit a PR for this?
The whole idea of a null handler (the null object pattern in general) is so you don't have to do checks like that. Someone didn't get the memo I guess.
Do you want to submit a PR for this?
Possibly, eventually. I have some other changes in the works that would merge badly with this change.
There is a lot blocks in
MQTT
that go like this:The check for the logger makes the code more difficult to read. Setting a logger with
NullHandler
by default and replacing the handler withStreamHandler
inenable_logger()
would avoid these contructs.