Adjust logging (#24082)

* Make sure we log full path to debug log

* Make sure we log the exception to debug log
This commit is contained in:
Joakim Plate 2019-05-25 00:54:04 +02:00 committed by Paulus Schoutsen
parent 14d169558f
commit e9f561e7ab
1 changed files with 5 additions and 5 deletions

View File

@ -207,7 +207,7 @@ async def async_prepare_setup_platform(hass: core.HomeAssistant,
def log_error(msg: str) -> None:
"""Log helper."""
_LOGGER.error("Unable to prepare setup for platform %s: %s",
platform_name, msg)
platform_path, msg)
async_notify_setup_error(hass, platform_path)
try:
@ -226,8 +226,8 @@ async def async_prepare_setup_platform(hass: core.HomeAssistant,
try:
platform = integration.get_platform(domain)
except ImportError:
log_error("Platform not found.")
except ImportError as exc:
log_error("Platform not found ({}).".format(exc))
return None
# Already loaded
@ -239,8 +239,8 @@ async def async_prepare_setup_platform(hass: core.HomeAssistant,
if integration.domain not in hass.config.components:
try:
component = integration.get_component()
except ImportError:
log_error("Unable to import the component")
except ImportError as exc:
log_error("Unable to import the component ({}).".format(exc))
return None
if (hasattr(component, 'setup')