Create a gist now

Instantly share code, notes, and snippets.

Excerpt from app delegate for setting up RestKit logging. I was getting an undefined constant error for RKLogConfigureByName, the standard way of setting up logging in restkit. It seems that the #define statements in /vendor/Pods/RestKit/Code/Support/RKLog.h are not getting picked up. I will need to investigate further but this quick workaround …
def init_restkit_logging
#define RKLogLevelOff -> RKlcl_vOff
#define RKLogLevelCritical -> RKlcl_vCritical
#define RKLogLevelError -> RKlcl_vError
#define RKLogLevelWarning -> RKlcl_vWarning
#define RKLogLevelInfo -> RKlcl_vInfo
#define RKLogLevelDebug -> RKlcl_vDebug
#define RKLogLevelTrace -> RKlcl_vTrace
# "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"
RKlcl_configure_by_name("Restkit", RKlcl_vDebug)
RKlcl_configure_by_name("App", RKlcl_vDebug)
RKlcl_configure_by_name("RestKit/Network*", RKlcl_vTrace)
RKlcl_configure_by_name("RestKit/ObjectMapping", RKlcl_vTrace)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment