From a976ef6e67204aa55bf7c58300f0154b7b567a00 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 9 Nov 2020 09:56:01 +0100 Subject: [PATCH] Cleanup some logger (#2229) --- supervisor/auth.py | 2 +- supervisor/bootstrap.py | 6 +++--- supervisor/core.py | 4 ++-- supervisor/docker/interface.py | 4 ++-- supervisor/homeassistant/secrets.py | 2 +- supervisor/plugins/dns.py | 3 --- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/supervisor/auth.py b/supervisor/auth.py index bff19438b..9b3ad0be0 100644 --- a/supervisor/auth.py +++ b/supervisor/auth.py @@ -73,7 +73,7 @@ class Auth(JsonConfig, CoreSysAttributes): # Check API state if not await self.sys_homeassistant.api.check_api_state(): - _LOGGER.debug("Home Assistant not running, checking cache") + _LOGGER.info("Home Assistant not running, checking cache") return cache_hit is True # No cache hit diff --git a/supervisor/bootstrap.py b/supervisor/bootstrap.py index ff4163e94..ac8dada53 100644 --- a/supervisor/bootstrap.py +++ b/supervisor/bootstrap.py @@ -95,7 +95,7 @@ async def initialize_coresys() -> CoreSys: coresys.machine = os.environ[ENV_SUPERVISOR_MACHINE] elif os.environ.get(ENV_HOMEASSISTANT_REPOSITORY): coresys.machine = os.environ[ENV_HOMEASSISTANT_REPOSITORY][14:-14] - _LOGGER.debug("Seting up coresys for machine: %s", coresys.machine) + _LOGGER.info("Seting up coresys for machine: %s", coresys.machine) return coresys @@ -119,7 +119,7 @@ def initialize_system_data(coresys: CoreSys) -> None: # Supervisor addon data folder if not config.path_addons_data.is_dir(): - _LOGGER.info( + _LOGGER.debug( "Creating Supervisor Add-on data folder at '%s'", config.path_addons_data ) config.path_addons_data.mkdir(parents=True) @@ -286,7 +286,7 @@ def supervisor_debugger(coresys: CoreSys) -> None: debugpy.listen(("0.0.0.0", 33333)) if coresys.config.debug_block: - _LOGGER.debug("Wait until debugger is attached") + _LOGGER.info("Wait until debugger is attached") debugpy.wait_for_client() diff --git a/supervisor/core.py b/supervisor/core.py index 002845db2..389266053 100644 --- a/supervisor/core.py +++ b/supervisor/core.py @@ -162,7 +162,7 @@ class Core(CoreSysAttributes): try: # HomeAssistant is already running / supervisor have only reboot if self.sys_hardware.last_boot == self.sys_config.last_boot: - _LOGGER.debug("Supervisor reboot detected") + _LOGGER.info("Supervisor reboot detected") return # reset register services / discovery @@ -190,7 +190,7 @@ class Core(CoreSysAttributes): except HomeAssistantError as err: self.sys_capture_exception(err) else: - _LOGGER.debug("Skiping start of Home Assistant") + _LOGGER.info("Skiping start of Home Assistant") # start addon mark as application await self.sys_addons.boot(AddonStartup.APPLICATION) diff --git a/supervisor/docker/interface.py b/supervisor/docker/interface.py index 051ec36fc..4ff74339f 100644 --- a/supervisor/docker/interface.py +++ b/supervisor/docker/interface.py @@ -524,13 +524,13 @@ class DockerInterface(CoreSysAttributes): raise ValueError() except (docker.errors.DockerException, ValueError) as err: - _LOGGER.debug("No version found for %s", self.image) + _LOGGER.info("No version found for %s", self.image) raise DockerNotFound() from err except requests.RequestException as err: _LOGGER.warning("Communication issues with dockerd on Host: %s", err) raise DockerRequestError() from err else: - _LOGGER.debug("Found %s versions: %s", self.image, available_version) + _LOGGER.info("Found %s versions: %s", self.image, available_version) # Sort version and return latest version available_version.sort(key=pkg_version.parse, reverse=True) diff --git a/supervisor/homeassistant/secrets.py b/supervisor/homeassistant/secrets.py index 5214233a8..5ae863af4 100644 --- a/supervisor/homeassistant/secrets.py +++ b/supervisor/homeassistant/secrets.py @@ -61,4 +61,4 @@ class HomeAssistantSecrets(CoreSysAttributes): except (YAMLError, AttributeError) as err: _LOGGER.error("Can't process Home Assistant secrets: %s", err) else: - _LOGGER.debug("Reloading Home Assistant secrets: %s", len(self.secrets)) + _LOGGER.info("Reloading Home Assistant secrets: %s", len(self.secrets)) diff --git a/supervisor/plugins/dns.py b/supervisor/plugins/dns.py index 57b2f21b3..14ce2f2de 100644 --- a/supervisor/plugins/dns.py +++ b/supervisor/plugins/dns.py @@ -374,10 +374,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes): def delete_host(self, host: str, write: bool = True) -> None: """Remove a entry from hosts.""" entry = self._search_host([host]) - - # No match on hosts if not entry: - _LOGGER.debug("Can't remove Host entry: %s", host) return _LOGGER.debug("Removing host entry %s - %s", entry.ip_address, entry.names)