Add logs for part upload

This commit is contained in:
Neeraj Gupta 2024-05-08 11:37:37 +05:30
parent 27aaf98c4d
commit 34ea7749ab
2 changed files with 5 additions and 1 deletions

View file

@ -187,7 +187,9 @@ class MultiPartUploader {
final isLastPart = i == partsLength - 1;
final fileSize =
isLastPart ? encryptedFile.lengthSync() % partSize : partSize;
_logger.info(
"Uploading part ${i + 1} / $partsLength of size $fileSize bytes (total size ${encryptedFile.lengthSync()}).",
);
final response = await _s3Dio.put(
partURL,
data: encryptedFile.openRead(

View file

@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
import "dart:developer" as dev;
import 'dart:io';
import 'dart:math' as math;
@ -576,6 +577,7 @@ class FileUploader {
final fileUploadURL = await _getUploadURL();
fileObjectKey = await _putFile(fileUploadURL, encryptedFile);
} else {
dev.log("Init multipartUpload $multipartEntryExists", name: "Uploader");
if (multipartEntryExists) {
fileObjectKey = await _multiPartUploader.putExistingMultipartFile(
encryptedFile,