Skip to content

Commit 4b34d8d

Browse files
Updated debug logs to include the persistence name
1 parent dc3c9df commit 4b34d8d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/CodableDatastore/Persistence/Disk Persistence/DiskPersistence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ extension DiskPersistence {
565565
}
566566

567567
let currentCounter = nextTransactionCounter()
568-
// print("[CDS] Starting transaction \(currentCounter) “\(actionName ?? "")” - \(options)")
568+
// print("[CDS] [\(storeURL.lastPathComponent)] Starting transaction \(currentCounter) “\(actionName ?? "")” - \(options)")
569569
let (transaction, task) = await Transaction.makeTransaction(
570570
persistence: self,
571571
transactionIndex: currentCounter,
@@ -582,7 +582,7 @@ extension DiskPersistence {
582582
}
583583

584584
let result = try await task.value
585-
// print("[CDS] Finished transaction \(currentCounter) “\(actionName ?? "")” - \(options)")
585+
// print("[CDS] [\(storeURL.lastPathComponent)] Finished transaction \(currentCounter) “\(actionName ?? "")” - \(options)")
586586
return result
587587
}
588588
}
@@ -607,7 +607,7 @@ extension DiskPersistence {
607607
/// If nothing changed, don't bother writing anything.
608608
if !containsEdits { return }
609609

610-
// print("[CDS] Persisting \(transactionIndex) “\(actionName ?? "")” - \(roots.keys), added \(addedDatastoreRoots), removed \(removedDatastoreRoots)")
610+
// print("[CDS] [\(storeURL.lastPathComponent)] Persisting \(transactionIndex) “\(actionName ?? "")” - \(roots.keys), added \(addedDatastoreRoots), removed \(removedDatastoreRoots)")
611611

612612
/// If we are read-only, make sure no edits have been made
613613
guard let self = self as? DiskPersistence<ReadWrite>

Sources/CodableDatastore/Persistence/Disk Persistence/Transaction/Transaction.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extension DiskPersistence {
152152

153153
/// If the transaction has a parent, offload responsibility to it to persist the changes along with other children.
154154
if let parent {
155-
// print("[CDS] Offloading persist to parent \(transactionIndex) - \(options)")
155+
// print("[CDS] [\(persistence.storeURL.lastPathComponent)] Offloading persist to parent \(transactionIndex) - \(options)")
156156
try await parent.apply(
157157
rootObjects: rootObjects,
158158
entryMutations: entryMutations,
@@ -211,7 +211,7 @@ extension DiskPersistence {
211211
@_inheritActorContext handler: @Sendable @escaping (_ transaction: Transaction, _ isDurable: Bool) async throws -> T
212212
) async -> (Transaction, Task<T, Error>) {
213213
if let parent = Self.unsafeCurrentTransaction(for: persistence) {
214-
// print("[CDS] Found parent \(parent.transactionIndex), making child \(transactionIndex)")
214+
// print("[CDS] [\(persistence.storeURL.lastPathComponent)] Found parent \(parent.transactionIndex), making child \(transactionIndex)")
215215
let (child, task) = await parent.childTransaction(
216216
transactionIndex: transactionIndex,
217217
actionName: actionName,

0 commit comments

Comments
 (0)