Increase logging level of errors while doing jobs (#4429)

This commit is contained in:
Paulus Schoutsen 2016-11-16 23:01:14 -08:00 committed by GitHub
parent c8bc1e3c5d
commit 38d201a54a

View file

@ -306,21 +306,14 @@ class HomeAssistant(object):
@callback
def _async_exception_handler(self, loop, context):
"""Handle all exception inside the core loop."""
message = context.get('message')
if message:
_LOGGER.warning(
"Error inside async loop: %s",
message
)
# for debug modus
kwargs = {}
exception = context.get('exception')
if exception is not None:
exc_info = (type(exception), exception, exception.__traceback__)
_LOGGER.debug(
"Exception inside async loop: ",
exc_info=exc_info
)
if exception:
kwargs['exc_info'] = (type(exception), exception,
exception.__traceback__)
_LOGGER.error('Error doing job: %s', context['message'],
**kwargs)
@callback
def _async_stop_handler(self, *args):