logBatch<T extends SyncModelSyncable> method
Future<void>
logBatch<T extends SyncModelSyncable>(
- List<
T> entities, - SyncOperation operation, {
- bool isFileToUpload = false,
override
Implementation
@override
Future<void> logBatch<T extends SyncModelSyncable>(
List<T> entities,
SyncOperation operation, {
bool isFileToUpload = false,
}) async {
for (final entity in entities) {
final log = SyncLog(
syncId: const Uuid().v4(),
entityType: entity.runtimeType.toString(),
entityId: entity.id,
operation: operation,
dataJson: jsonEncode(entity.toJson()),
isFileToUpload: isFileToUpload,
isSynced: false,
retryCount: 0,
createdAt: DateTime.now(),
);
await _logStorage.createLog(log);
}
_loggerDebugProvider?.info(
'Batch of ${entities.length} logs registered - ${operation.value}',
category: 'sync_logger',
tag: 'batch',
metadata: {
'count': entities.length,
'operation': operation.value,
'isFileToUpload': isFileToUpload,
},
);
}