From fb394a6de4fdadf7542fc51310023b3d7d1ad81a Mon Sep 17 00:00:00 2001 From: Ajeya Bhat Date: Tue, 21 May 2024 15:39:11 +0530 Subject: [PATCH] logging --- outpostcli/lfs/part.py | 8 +++++++- outpostcli/lfs/storage_class/gcs.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/outpostcli/lfs/part.py b/outpostcli/lfs/part.py index afe9461..d37b1eb 100644 --- a/outpostcli/lfs/part.py +++ b/outpostcli/lfs/part.py @@ -39,13 +39,19 @@ def transfer_part(part: PartInfo): read_limit=part.chunk_size, ) as data: try: + _log.info(f"uploading part of {part.filepath}, part no: {part.no}") r = retriable_upload_part(part.url, data) + etag = str(r.headers.get("etag")) + _log.info( + f"completed upload part of {part.filepath}, part no: {part.no}, etag: {etag}" + ) return UploadedPartObject( { - "etag": str(r.headers.get("etag")), + "etag": etag, "part_number": part.no, } ) + except Exception as e: _log.error(e) return ProxyLFSException(code=500, message=f"Unhandled Error: {e}") diff --git a/outpostcli/lfs/storage_class/gcs.py b/outpostcli/lfs/storage_class/gcs.py index 96805f1..04fbd92 100644 --- a/outpostcli/lfs/storage_class/gcs.py +++ b/outpostcli/lfs/storage_class/gcs.py @@ -53,7 +53,7 @@ def gcs_multipart_upload(msg: Dict[str, Any]): initiate_url = msg["action"]["href"] upload_id = initiate_multipart_upload(initiate_url) - + _log.info(f"initiated multipart upload of file {filepath}, upload_id: {upload_id}") header = msg["action"]["header"] chunk_size = int(header.pop("chunk_size")) abort_url = gen_upload_specific_url(str(header.pop("abort_url")), upload_id)