Disable CloudKit debugging logs
Asked Answered
I

1

23

I am using a NSPersistentCloudKitContainer for the database in my iOS app. By default it seems to log all events to the console, I am assuming for debugging purposes. These messages look like this:

CoreData: CloudKit: CoreData+CloudKit: -[PFCloudKitExportContext processAnalyzedHistoryInStore:inManagedObjectContext:error:]_block_invoke_4(201): Finished processing analyzed history with 1 metadata objects to create, 0 deleted rows without metadata.
CoreData: CloudKit: CoreData+CloudKit: -[PFCloudKitExporter exportIfNecessary]_block_invoke_2(137): <PFCloudKitExporter: 0x282a785f0>: Found 2 objects needing export.
CoreData: warning: CoreData+CloudKit: -[PFCloudKitExporter exportOperationFinished:withSavedRecords:deletedRecordIDs:operationError:](384): Modify records finished: (
    etc...

They are constant and are getting in the way of other debug messages, is there any way to disable them?

Intermezzo answered 19/11, 2019 at 16:10 Comment(0)
C
59

I use these two arguments to reduce the output (Arguments passed on launch):

disable CoreData debug output:

-com.apple.CoreData.Logging.stderr 0

disable CloudKit debug output

-com.apple.CoreData.CloudKitDebug 0

enter image description here

Products > Scheme > Edit scheme

Create answered 1/12, 2019 at 12:48 Comment(2)
With these settings, you can still see some significant CloudKit log entires in Console. Just search for CK or your app id. I am using these with -com.apple.CoreData.ConcurrencyDebug 1Beggary
It works also for SwiftData. I have a question though: Where did you get those arguments from? Now that I know the exact arguments I'm able to search for any documentation on them. But there are many more arguments and it's hard to find a comprehensive list of them.Absonant

© 2022 - 2024 — McMap. All rights reserved.