Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debugging flag #28

Closed
Revolucent opened this issue Apr 3, 2016 · 3 comments
Closed

Add debugging flag #28

Revolucent opened this issue Apr 3, 2016 · 3 comments
Assignees
Milestone

Comments

@Revolucent
Copy link
Member

Add a launch flag along the lines of -com.apple.CoreData.SQLDebug, but instead of printing out the SQL (for which you can already use the aforementioned tag), this will print out any generated predicates, and possibly other useful information.

-com.prosumma.CoreDataQueryInterface.Debug, perhaps?

@Revolucent Revolucent added this to the 4.0 milestone Apr 3, 2016
@Revolucent Revolucent self-assigned this Apr 4, 2016
Revolucent added a commit that referenced this issue Apr 4, 2016
@Revolucent
Copy link
Member Author

Closed in d2a2a66

@patgoley
Copy link
Contributor

patgoley commented Apr 4, 2016

@Revolucent Just looked over this for fun. One thing to note, and this probably doesn't matter, but print only logs to the debug console while NSLog also prints to the device console. I can't think of a reason that someone would ship a production build with the logging enabled but if they did, they wouldn't be able to read it from the device console or at all. Just wanted to make sure we intentionally opted for that limitation.

I am one for splitting hairs obviously :) I just feel like if you opt for the logging flag you should get the full service. But probably no one cares.

@Revolucent
Copy link
Member Author

I am one for splitting hairs obviously.

Me, too. I think we just tend to split different hairs. But in this case, I think I will switch to NSLog. When Swift was released, people simply stopped using NSLog. All of the examples used print (well println). I simply assumed it was Swift's NSLog and left it at that. I never even noticed that it didn't print the date. The truth is I never thought too deeply about it, so good to know the distinction.

What I'm surprised didn't leap out at you was this brain dead code:

NSProcossInfo().arguments.filter{ $0 == "-com.prosumma.CoreDataQueryInterface.Debug" }.count > 0

It should have been:

NSProcessInfo().arguments.contains("-com.prosumma.CoreDataQueryInterface.Debug")

I'll make the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants