Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

ParseLogInterceptor

Roger Hu edited this page Mar 24, 2017 · 7 revisions

ParseLogInterceptor can log the http requests and responses between Parse SDK and Parse server to Android logcat. You can follow this tutorial to add ParseLogInterceptor to your app.

Configure Parse SDK in your app

Check the website and getting started about how to setup Parse.

Add ParseInterceptors dependency to your app

In your app's build.gradle, add dependency from maven.

dependencies {
    compile 'com.parse:parse-android:1.14.0'
    debugCompile 'com.parse:parseinterceptors:0.0.2'
    // If you are using okhttp in your app, make sure you use 2.5.0 or above
    // compile com.squareup.okhttp:okhttp:2.5.0
}

Add ParseLogInterceptor to Parse

In you app's Application#oncreate(), initialize a ParseLogInterceptor and add it to Parse. Make sure you add ParseLogInterceptor before you initialize Parse.

Parse.addParseNetworkInterceptor(new ParseLogInterceptor());
// Interceptor should be added before your initialize Parse
Parse.initialize(this); 

Filter results through Android logcat

After Parse SDK sends http requests to Parse server, you can check the http requests and responses information in Android logcat. In your command line tool, you can run

adb logcat -s ParseLogInterceptor

then you will see

Right now, ParseLogInterceptor only prints json or plain string http body to Android logcat. If you upload/download using a ParseFile, the http body will be ignored.

Clone this wiki locally