eiv*_*dml 3 macos core-data ios swift
I'm working on a iOS/macOS project where I'm using CoreData. It works fine, but it outputs enormous amounts of debugging info to the Console. This makes the Console unusable, since my print statements are buried in all the CoreData related stuff.
I have a pretty simple CoreData setup with fetching of some data, so these are not errors, just general event logs it seems. I have the same results on other projects I have used CoreData.
Any way to reduce/remove this logging to the console?
Some sample data (all data here):
CoreData: warning: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _
performExportWithRequest:]_block_invoke_2(946): Finished export: <PFCloudKitExporter: 0x2838bd840>
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _finishedRequest:withResult:](2102): Finished request: <NSCloudKitMirroringExportRequest: 0x2823bbb40> DC26CDEE-0AB6-42CD-81E5-996E7E7727F9 with result: <NSCloudKitMirroringResult: 0x282dfcfa0> success: 1 madeChanges: 0 error: (null)
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _scheduleAutomatedExportWithLabel:activity:completionHandler:]_block_invoke(2170): <NSCloudKitMirroringDelegate: 0x281ae4580> - Finished automatic export - AppActivationExport - with result: <NSCloudKitMirroringResult: 0x282dfcfa0> success: 1 madeChanges: 0 error: (null)
CoreData: warning: CoreData+CloudKit: -[NSCloudKitMirroringDelegate finishedAutomatedRequestWithResult:](2115): Finished request '<NSCloudKitMirroringExportRequest: 0x2823bbb40> DC26CDEE-0AB6-42CD-81E5-996E7E7727F9' with result: <NSCloudKitMirroringResult: 0x282dfcfa0> success: 1 madeChanges: 0 error: (null)
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](2073): <NSCloudKitMirroringDelegate: 0x281ae4580>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(2088): <NSCloudKitMirroringDelegate: 0x281ae4580>: No more requests to execute.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _scheduleAutomatedImportWithLabel:activity:completionHandler:](2140): <NSCloudKitMirroringDelegate: 0x281ae4580> - Beginning automated import - ImportActivity - in response to activity:
<CKSchedulerActivity: 0x280ec8f00; additionalXPCActivityCriteria={
Priority = Utility;
}
Run Code Online (Sandbox Code Playgroud)
AD *_*ess 46
尝试将这些添加为启动参数,看看它是否有帮助
-com.apple.CoreData.SQLDebug 0
-com.apple.CoreData.Logging.stderr 0
-com.apple.CoreData.ConcurrencyDebug 0
-com.apple.CoreData.MigrationDebug 0
Run Code Online (Sandbox Code Playgroud)
EDIT1:我在 Apple 文档中找到了这个:选择 Product > Scheme > Edit Scheme。选择一个操作,例如 Run,然后选择 Arguments 选项卡。将带有调试级别值的 com.apple.CoreData.CloudKitDebug 用户默认设置作为参数传递给应用程序。

-com.apple.CoreData.CloudKitDebug 0
Run Code Online (Sandbox Code Playgroud)
添加最后一个作为启动参数,您应该实现您想要的。
链接到 AppleDocs 检查名为Debug Errors in Core Data with CloudKit 的部分
在 Xcode 中执行以下步骤:
我想您会-com.apple.CoreData.SQLDebug在“发布时传递的参数”中看到。如果您看到该内容,请将其关闭。如果您没有看到它,请添加:
-com.apple.CoreData.SQLDebug 1
Run Code Online (Sandbox Code Playgroud)
数值和描述:
来自http://blog.raymccrae.scot/2017/12/core-data-sqldebug-log-levels.html
我有同样的问题。
这将禁用CoreData调试输出:
在“启动时传递的参数”中:
-com.apple.CoreData.Logging.stderr 0
对我有用。
| 归档时间: |
|
| 查看次数: |
322 次 |
| 最近记录: |