mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
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:
|
def log_error(msg: str) -> None:
|
||||||
"""Log helper."""
|
"""Log helper."""
|
||||||
_LOGGER.error("Unable to prepare setup for platform %s: %s",
|
_LOGGER.error("Unable to prepare setup for platform %s: %s",
|
||||||
platform_name, msg)
|
platform_path, msg)
|
||||||
async_notify_setup_error(hass, platform_path)
|
async_notify_setup_error(hass, platform_path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -226,8 +226,8 @@ async def async_prepare_setup_platform(hass: core.HomeAssistant,
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
platform = integration.get_platform(domain)
|
platform = integration.get_platform(domain)
|
||||||
except ImportError:
|
except ImportError as exc:
|
||||||
log_error("Platform not found.")
|
log_error("Platform not found ({}).".format(exc))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Already loaded
|
# Already loaded
|
||||||
@ -239,8 +239,8 @@ async def async_prepare_setup_platform(hass: core.HomeAssistant,
|
|||||||
if integration.domain not in hass.config.components:
|
if integration.domain not in hass.config.components:
|
||||||
try:
|
try:
|
||||||
component = integration.get_component()
|
component = integration.get_component()
|
||||||
except ImportError:
|
except ImportError as exc:
|
||||||
log_error("Unable to import the component")
|
log_error("Unable to import the component ({}).".format(exc))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if (hasattr(component, 'setup')
|
if (hasattr(component, 'setup')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user