Closed Santobert closed 3 years ago
Will this allow HA to display the error?
Will this allow HA to display the error?
Depending on their configuration. I haven't tested it yet. I changed this mainly because I think it's good practice to use logging instead of printing.
I agree that logging is preferred to printing, but I guess we should do some testing with HA before merging this to avoid introducing potentially breaking changes before the HA update?
2019-10-19 20:56:11 INFO (MainThread) [homeassistant.components.mailbox] Setting up mailbox.demo
2019-10-19 20:56:11 INFO (MainThread) [homeassistant.components.switch] Setting up switch.demo
2019-10-19 20:56:11 INFO (MainThread) [homeassistant.components.light] Setting up light.demo
2019-10-19 20:56:11 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.legacy
2019-10-19 20:56:13 WARNING (SyncWorker_1) [pybotvac.account] Your robot Sally is offline.
2019-10-19 20:56:14 WARNING (SyncWorker_1) [pybotvac.account] Your robot Sally is offline.
2019-10-19 20:56:14 INFO (MainThread) [homeassistant.components.switch] Setting up switch.neato
2019-10-19 20:56:14 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.neato
2019-10-19 20:56:14 INFO (SyncWorker_4) [homeassistant.loader] Loaded vacuum from homeassistant.components.vacuum
2019-10-19 20:56:14 INFO (MainThread) [homeassistant.setup] Setting up vacuum
2019-10-19 20:56:14 INFO (MainThread) [homeassistant.setup] Setup of domain vacuum took 0.0 seconds.
2019-10-19 20:56:14 INFO (MainThread) [homeassistant.components.vacuum] Setting up vacuum.neato
2019-10-19 20:56:17 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 6.49s
2019-10-19 20:56:17 INFO (MainThread) [homeassistant.core] Starting Home Assistant
This didn't break anything. Instead of the raw print a log message is now displayed.
That is much better!
I've replaced that
print
call with alogging.warning
statement. Please reject this PR if this is unwanted. :slightly_smiling_face: