Skip to content

Commit 8b098bf

Browse files
authored
Merge pull request #2420 from sopel-irc/safety-logging-tweaks
safety: logging level tweaks
2 parents 4bc3233 + 091aa90 commit 8b098bf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sopel/modules/safety.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ def setup(bot: Sopel):
118118
except Exception as err:
119119
# for lack of a more specific error type...
120120
# Python on Windows throws an exception if the file is in use
121-
LOGGER.info('Could not delete %s: %s', old_file, str(err))
121+
LOGGER.warning('Could not delete %s: %s', old_file, str(err))
122122

123+
LOGGER.info('Ensuring unsafe domain list is up-to-date (safety plugin setup)')
123124
update_local_cache(bot, init=True)
124125

125126

@@ -141,12 +142,12 @@ def download_domain_list(bot: Sopel, path: str) -> bool:
141142
url = bot.settings.safety.domain_blocklist_url
142143
if url is None or not url.startswith("http"):
143144
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
144-
LOGGER.info("Downloading unsafe domain list from %s", url)
145+
LOGGER.debug("Downloading unsafe domain list from %s", url)
145146
old_etag = bot.db.get_plugin_value("safety", "unsafe_domain_list_etag")
146147
if old_etag:
147148
r = requests.head(url)
148149
if r.headers["ETag"] == old_etag and os.path.isfile(path):
149-
LOGGER.info("Unsafe domain list unchanged, skipping")
150+
LOGGER.debug("Unsafe domain list unchanged, skipping")
150151
return False
151152

152153
r = requests.get(url, stream=True)
@@ -486,6 +487,6 @@ def _clean_cache(bot: Sopel):
486487

487488
LOGGER.debug('Safety cache cleanup finished.')
488489
else:
489-
LOGGER.info(
490+
LOGGER.debug(
490491
'Skipping safety cache cleanup: Cache is locked, '
491492
'cleanup already running.')

0 commit comments

Comments
 (0)