Skip to content Skip to sidebar Skip to footer

Retrofit2 HttpLoggingInterceptor Logcat

Probably a novice question but I'm wondering where I actually catch the logs in log cat. Is there a particular place I put a log, a special regex to use etc. This is what my interc

Solution 1:

I use so:

    // init okhttp 3 logger
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
        @Override public void log(String message) {
            Log.d("MyTAG", "OkHttp: " + message);
        }
    });
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);

Post a Comment for "Retrofit2 HttpLoggingInterceptor Logcat"