Restkit, Stop Logging? Restkit, Stop Logging? ios ios

Restkit, Stop Logging?


To turn everything off add this to your app delegate.

RKLogConfigureByName("*", RKLogLevelOff);

Note: At least in RestKit v0.20.x you will still see a "RestKit logging initialized..." message in dev builds.


To suppress just the Reachability messages, use this:

RKLogConfigureByName("RestKit/Network/Reachability", RKLogLevelCritical);

Look in lcl_config_components.h for the complete list:

 "restkit"                           "RestKit"  "restkit.network"                   "RestKit/Network"  "restkit.network.cache"             "RestKit/Network/Cache"  "restkit.network.queue"             "RestKit/Network/Queue"  "restkit.network.reachability"      "RestKit/Network/Reachability"  "restkit.object_mapping"            "RestKit/ObjectMapping"  "restkit.core_data"                 "RestKit/CoreData"  "restkit.core_data.cache"           "RestKit/CoreData/Cache"  "restkit.core_data.search_engine"   "RestKit/CoreData/SearchEngine"  "restkit.support"                   "RestKit/Support"  "restkit.support.parsers"           "RestKit/Support/Parsers"  "restkit.three20"                   "RestKit/Three20"  "restkit.ui"                        "RestKit/UI"  "restkit.testing"                   "RestKit/Testing"  "app"                               "App" 


The logging messages in a RestKit app are controlled by the RKLog calls. For example:

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

RKLog is implemented with Aren Harren's lcl_log (see http://0xc0.de/LibComponentLogging) library. I just briefly looked through the code for lcl and I didn't see any code that would prevent it from printing in a production version, so I would ensure that my RKLog code does not appear in production code.