Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam committed Jan 4, 2017
1 parent 37a7eef commit dc022e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions collectfast/etag.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import hashlib
import logging

from django.core.cache import caches

from collectfast import settings
from .log import log

try:
from functools import lru_cache
Expand All @@ -15,6 +15,7 @@ def decorator(func):
return decorator

cache = caches[settings.cache]
logger = logging.getLogger(__name__)


@lru_cache()
Expand Down Expand Up @@ -92,10 +93,10 @@ def should_copy_file(remote_storage, path, prefixed_path, source_storage):
# Compare hashes and skip copying if matching
if has_matching_etag(
remote_storage, source_storage, normalized_path):
log("Skipping '%s' based on matching file hashes" % path, level=2)
logger.info("%s: Skipping based on matching file hashes" % path)
return False

# Invalidate cached versions of lookup if copy is to be done
destroy_etag(normalized_path)
log("Hashes did not match", level=2)
logger.info("%s: Hashes did not match" % path)
return True
2 changes: 0 additions & 2 deletions collectfast/log.py

This file was deleted.

0 comments on commit dc022e4

Please sign in to comment.