我正在尝试调试RestKit对象映射,并注意到代码中有调用RKLogDebug
,但似乎该宏在某处未被定义。我应该如何启用它?
我正在尝试调试RestKit对象映射,并注意到代码中有调用RKLogDebug
,但似乎该宏在某处未被定义。我应该如何启用它?
RKLogConfigureByName("RestKit", RKLogLevelWarning);
RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelTrace);
RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);
请查看RKLog.h以了解不同级别的记录方式并将其添加到您的代码中。这可能有些棘手。
注意,这支持在结尾处使用通配符,例如:
RKLogConfigureByName("*", RKLogLevelTrace); // set all logs to trace,
RKLogConfigureByName("RestKit*", RKLogLevelWarning); // set all RestKit logs to warning (leaving the app-specific log untouched).
– 感谢Kevin!
针对Swift用户,请使用以下语法:
RKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.rawValue)
RKlcl_configure_by_na`enter code here`me("RestKit/ObjectMapping", RKlcl_vOff.rawValue)
- 感谢Darshit!
RKLogConfigureByName
来将您的应用程序配置到特定组件。
RKLogConfigureByName("*", RKLogLevelTrace);
将所有日志级别设置为追踪(trace),RKLogConfigureByName("RestKit*", RKLogLevelWarning);
将所有以RestKit
开头的日志级别设置为警告(warning),而不影响应用特定的日志。 - KevinRKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.rawValue)
RKlcl_configure_by_name("RestKit/ObjectMapping", RKlcl_vOff.rawValue)
https://dev59.com/go3da4cB1Zd3GeqP4cRQ - Darshit Mendapara