I'm trying to debug RestKit object mapping and noticed that there are calls to RKLogDebug
throughout the code, but it appears that that macro is undefined somewhere. How can I enable it?
2 Answers
You want to add something like this:
RKLogConfigureByName("RestKit", RKLogLevelWarning);
RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelTrace);
RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);
to your code. See RKLog.h for the various levels. It is pretty trick.
N.B. this supports a wildcard at the end so, e.g.,
RKLogConfigureByName("*", RKLogLevelTrace); // set all logs to trace,
RKLogConfigureByName("RestKit*", RKLogLevelWarning); // set all RestKit logs to warning (leaving the app-specific log untouched).
– Thanks Kevin!
For Swift user use this syntex:
RKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.rawValue)
RKlcl_configure_by_na`enter code here`me("RestKit/ObjectMapping", RKlcl_vOff.rawValue)
– Thanks Darshit!
-
5you are probably the most awesome person in the whole universe, you know?– jturollaNov 27, 2012 at 15:48
-
3N.B. this supports a wildcard at the end so, e.g.,
RKLogConfigureByName("*", RKLogLevelTrace);
will set all logs to trace,RKLogConfigureByName("RestKit*", RKLogLevelWarning);
will set allRestKit
logs to warning (leaving the app-specific log untouched).– KevinOct 16, 2013 at 20:34 -
I'd ask that as a new question, you'll probably get better results. (And no, off the top of my head I can't think of any...) Dec 12, 2013 at 13:36
-
1RestKit logging explained here restkit-tutorials.com/logging-in-restkit-debug-tips Jan 2, 2014 at 11:09
-
For Swift user use this syntex:
RKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.rawValue)
RKlcl_configure_by_name("RestKit/ObjectMapping", RKlcl_vOff.rawValue)
stackoverflow.com/questions/31830976/… Aug 26, 2021 at 5:30
As described in first answer you can configure your app to specific component by calling RKLogConfigureByName
.
You can also configure RestKit for specific component using Environment Variables in Xcode scheme. This is useful especially when you have your app building continuously for different environments.
Here's detailed explanation of RestKit logging http://restkit-tutorials.com/logging-in-restkit-debug-tips/
-
1hey @Borzh it is available here in archive web.archive.org/web/20150706073124/http://… Jan 24, 2018 at 12:55