Skip to content

Commit 05bc2cb

Browse files
committed
file-mode-api: add logging to file creation
1 parent 962ddbe commit 05bc2cb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

airbyte_cdk/sources/declarative/retrievers/file_uploader.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import logging
23
from pathlib import Path
34
from typing import Optional
45

@@ -11,6 +12,7 @@
1112
from airbyte_cdk.sources.declarative.types import Record, StreamSlice
1213
from airbyte_cdk.sources.utils.files_directory import get_files_directory
1314

15+
logger = logging.getLogger("airbyte")
1416

1517
class FileUploader:
1618
def __init__(
@@ -54,6 +56,11 @@ def upload(self, record: Record) -> None:
5456
f.write(response.content)
5557
file_size_bytes = full_path.stat().st_size
5658

59+
logger.info("File uploaded successfully")
60+
logger.info(f"File path: {full_path} ")
61+
logger.info(f"File size: {file_size_bytes / 1024} KB")
62+
logger.info(f"File download target: {download_target}")
63+
5764
record.file_reference = AirbyteRecordMessageFileReference(
5865
file_url=download_target,
5966
file_relative_path=str(file_relative_path),

0 commit comments

Comments
 (0)