1
1
import Foundation
2
2
import CoreData
3
- // import CocoaLumberjackSwift
3
+ import CocoaLumberjackSwift
4
4
import BuildSettingsKit
5
5
import WordPressKit
6
6
@@ -39,7 +39,7 @@ public final class SharedCoreDataStack {
39
39
let container = SharedPersistentContainer ( name: " SharedCoreDataStack " , managedObjectModel: SharedCoreDataStack . model)
40
40
container. loadPersistentStores { ( storeDescription, error) in
41
41
if let error = error as NSError ? {
42
- // DDLogError("Error loading persistent stores: \(error), \(error.userInfo)")
42
+ DDLogError ( " Error loading persistent stores: \( error) , \( error. userInfo) " )
43
43
}
44
44
}
45
45
return container
@@ -71,7 +71,7 @@ public final class SharedCoreDataStack {
71
71
do {
72
72
try managedContext. save ( )
73
73
} catch let error as NSError {
74
- // DDLogError("Error saving context: \(error), \(error.userInfo)")
74
+ DDLogError ( " Error saving context: \( error) , \( error. userInfo) " )
75
75
}
76
76
}
77
77
}
@@ -120,7 +120,7 @@ extension SharedCoreDataStack {
120
120
do {
121
121
postUploadOp = try managedContext. existingObject ( with: postUploadOpObjectID) as? PostUploadOperation
122
122
} catch {
123
- // DDLogError("Error loading PostUploadOperation Object with ID: \(postUploadOpObjectID)")
123
+ DDLogError ( " Error loading PostUploadOperation Object with ID: \( postUploadOpObjectID) " )
124
124
}
125
125
return postUploadOp
126
126
}
@@ -151,7 +151,7 @@ extension SharedCoreDataStack {
151
151
let request = NSFetchRequest < NSFetchRequestResult > ( entityName: " MediaUploadOperation " )
152
152
request. predicate = NSPredicate ( format: " (groupID == %@) " , groupID)
153
153
guard let results = ( try ? managedContext. fetch ( request) ) as? [ MediaUploadOperation ] else {
154
- // DDLogError("Failed to fetch MediaUploadOperation for group ID: \(groupID)")
154
+ DDLogError ( " Failed to fetch MediaUploadOperation for group ID: \( groupID) " )
155
155
return nil
156
156
}
157
157
return results
@@ -195,7 +195,7 @@ extension SharedCoreDataStack {
195
195
do {
196
196
uploadOps = try managedContext. fetch ( request) as! [ MediaUploadOperation ]
197
197
} catch {
198
- // DDLogError("Failed to fetch MediaUploadOperation: \(error)")
198
+ DDLogError ( " Failed to fetch MediaUploadOperation: \( error) " )
199
199
}
200
200
201
201
return uploadOps
@@ -217,7 +217,7 @@ extension SharedCoreDataStack {
217
217
do {
218
218
uploadOp = try managedContext. existingObject ( with: uploadOpObjectID) as? UploadOperation
219
219
} catch {
220
- // DDLogError("Error setting \(status.stringValue) status for UploadOperation Object with ID: \(uploadOpObjectID) — could not fetch object.")
220
+ DDLogError ( " Error setting \( status. stringValue) status for UploadOperation Object with ID: \( uploadOpObjectID) — could not fetch object. " )
221
221
return
222
222
}
223
223
uploadOp? . currentStatus = status
@@ -260,7 +260,7 @@ extension SharedCoreDataStack {
260
260
///
261
261
public func updateMediaOperation( for fileName: String , with sessionID: String , remoteMediaID: Int64 ? , remoteURL: String ? , width: Int32 ? , height: Int32 ? ) {
262
262
guard let mediaUploadOp = fetchMediaUploadOp ( for: fileName, with: sessionID) else {
263
- // DDLogError("Error loading UploadOperation Object with File Name: \(fileName)")
263
+ DDLogError ( " Error loading UploadOperation Object with File Name: \( fileName) " )
264
264
return
265
265
}
266
266
@@ -305,7 +305,7 @@ extension SharedCoreDataStack {
305
305
///
306
306
public func updatePostOperation( with status: UploadOperation . UploadStatus , remotePostID: Int64 , forPostUploadOpWithObjectID postUploadOpObjectID: NSManagedObjectID ) {
307
307
guard let postUploadOp = ( try ? managedContext. existingObject ( with: postUploadOpObjectID) ) as? PostUploadOperation else {
308
- // DDLogError("Error loading PostUploadOperation Object with ID: \(postUploadOpObjectID)")
308
+ DDLogError ( " Error loading PostUploadOperation Object with ID: \( postUploadOpObjectID) " )
309
309
return
310
310
}
311
311
postUploadOp. currentStatus = status
@@ -324,7 +324,7 @@ extension SharedCoreDataStack {
324
324
do {
325
325
uploadOp = try managedContext. existingObject ( with: uploadOpObjectID) as? UploadOperation
326
326
} catch {
327
- // DDLogError("Error loading UploadOperation Object with ID: \(uploadOpObjectID)")
327
+ DDLogError ( " Error loading UploadOperation Object with ID: \( uploadOpObjectID) " )
328
328
return
329
329
}
330
330
uploadOp? . backgroundSessionTaskID = taskID. int32Value
0 commit comments