本文介绍了iPhone RestKit如何启用RKLogDebug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试RestKit对象映射,并注意到整个代码中都有对 RKLogDebug 的调用,但看起来该宏在某处未定义。如何启用它?

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?

推荐答案

您想要添加以下内容:

    RKLogConfigureByName("RestKit", RKLogLevelWarning); 
    RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelTrace);
    RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);

到你的代码。有关各个级别,请参阅RKLog.h。这很巧妙。

to your code. See RKLog.h for the various levels. It is pretty trick.

N.B。这支持最后的通配符,例如,

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). 

- 谢谢Kevin!

– Thanks Kevin!

这篇关于iPhone RestKit如何启用RKLogDebug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 14:28