com.apple.CoreData.SQLDebug not working

前端 未结 1 1589
误落风尘
误落风尘 2020-12-15 10:15

I\'m working with Xcode 8 with swift on MacOS Sierra in an iOS app. I realized a few months ago that the SQLDebug stops working... (It used to worked in my app)...

I

相关标签:
1条回答
  • 2020-12-15 10:36

    Core Data uses the new unified logging framework starting with iOS 10. There is a known issue in Xcode that interferes with the logging, but you can use -com.apple.CoreData.Logging.stderr 1 to get around it.

    EDIT: For clarity, you must specify -com.apple.CoreData.SQLDebug 1 in addition to the above. This actually enables the SQL trace, while the above will let you see it.

    From https://developer.apple.com/library/content/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html

    As part of this transition, Core Data honors user defaults to log to os_log, stderr, or both with ‘com.apple.CoreData.Logging.oslog’ or ‘com.apple.CoreData.Logging.stderr’. Due to a known issue in Xcode, it may be useful to toggle stderr logging on during debugging.

    You might also look in the new Console app, which will display logs from devices connected to your Mac.

    0 讨论(0)
提交回复
热议问题