mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Log threading exceptions properly (#34789)
This commit is contained in:
@@ -249,6 +249,10 @@ def async_enable_logging(
|
||||
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
||||
logging.getLogger("aiohttp.access").setLevel(logging.WARNING)
|
||||
|
||||
sys.excepthook = lambda *args: logging.getLogger(None).exception(
|
||||
"Uncaught exception", exc_info=args # type: ignore
|
||||
)
|
||||
|
||||
# Log errors to a file if we have write access to file or config dir
|
||||
if log_file is None:
|
||||
err_log_path = hass.config.path(ERROR_LOG_FILENAME)
|
||||
|
||||
Reference in New Issue
Block a user