Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safety: logging level tweaks #2420

Merged
merged 2 commits into from
Mar 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sopel/modules/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def setup(bot: Sopel):
except Exception as err:
# for lack of a more specific error type...
# Python on Windows throws an exception if the file is in use
LOGGER.info('Could not delete %s: %s', old_file, str(err))
LOGGER.warning('Could not delete %s: %s', old_file, str(err))

update_local_cache(bot, init=True)

Expand All @@ -141,12 +141,12 @@ def download_domain_list(bot: Sopel, path: str) -> bool:
url = bot.settings.safety.domain_blocklist_url
if url is None or not url.startswith("http"):
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
LOGGER.info("Downloading unsafe domain list from %s", url)
LOGGER.debug("Downloading unsafe domain list from %s", url)
Exirel marked this conversation as resolved.
Show resolved Hide resolved
old_etag = bot.db.get_plugin_value("safety", "unsafe_domain_list_etag")
if old_etag:
r = requests.head(url)
if r.headers["ETag"] == old_etag and os.path.isfile(path):
LOGGER.info("Unsafe domain list unchanged, skipping")
LOGGER.debug("Unsafe domain list unchanged, skipping")
return False

r = requests.get(url, stream=True)
Expand Down Expand Up @@ -486,6 +486,6 @@ def _clean_cache(bot: Sopel):

LOGGER.debug('Safety cache cleanup finished.')
else:
LOGGER.info(
LOGGER.debug(
'Skipping safety cache cleanup: Cache is locked, '
'cleanup already running.')