public class LogInterceptor
extends java.lang.Object
implements okhttp3.Interceptor
Interceptor| Constructor and Description |
|---|
LogInterceptor(Logger logger)
Creates a LogInterceptor, taking a logger to be logged to, once a request comes in.
|
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain)
Log the incomming request.
|
public LogInterceptor(Logger logger)
logger - a nonnull logger to be used.java.lang.IllegalArgumentException - if a null logger was given.public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws java.io.IOException
Once a request gets triggered in okhttp3, this interceptor gets called.
intercept in interface okhttp3.Interceptorchain - the chain of interceptor, provided by the okhttp3.java.io.IOException - in case of failure down the line.Copyright © 2019 Contentful, GmbH.. All Rights Reserved.