Commit 169b4cb8 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

add logging

parent cd37cc69
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@ from shutil import copyfile
from subprocess import call
from django.db.utils import IntegrityError
from unidecode import unidecode
import logging

logger = logging.getLogger(__name__)


def _file_hash256(file_path: str) -> str:
@@ -253,6 +256,7 @@ def handle_local_file(file_path: str, project: models.Project) -> int:
    # For any file, dump basic informations
    # to the filesystem.
    file.dump_infos_to_fs()
    logger.info("Added from local file: {} ({})".format(file.title, file.id))
    return file.id


@@ -293,6 +297,7 @@ def handle_uploaded_file(
    # For any file, dump basic informations
    # to the filesystem.
    file.dump_infos_to_fs()
    logger.info("Added from upload: {} ({})".format(file.title, file.id))
    return file.id