mirror of https://github.com/home-assistant/core
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:
parent
14d169558f
commit
e9f561e7ab
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue