Skip to content

Commit

Permalink
Adjust logging (#24082)
Browse files Browse the repository at this point in the history
* Make sure we log full path to debug log

* Make sure we log the exception to debug log
  • Loading branch information
elupus authored and balloob committed May 24, 2019
1 parent 14d1695 commit e9f561e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions homeassistant/setup.py
Expand Up @@ -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:
Expand All @@ -226,8 +226,8 @@ def log_error(msg: str) -> None:

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
Expand All @@ -239,8 +239,8 @@ def log_error(msg: str) -> None:
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')
Expand Down

0 comments on commit e9f561e

Please sign in to comment.