1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmz007 6d24f2138b
Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56)
3 years ago
..
src Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
README.md Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
pom.xml Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago

README.md

Logging Interceptor

An OkHttp interceptor which logs HTTP request and response data.

OkHttpClient client = new OkHttpClient();
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(Level.BASIC);
client.interceptors().add(logging);

You can change the log level at any time by calling setLevel.

To log to a custom location, pass a Logger instance to the constructor.

HttpLoggingInterceptor logging = new HttpLoggingInterceptor(new Logger() {
  @Override public void log(String message) {
    Timber.tag("OkHttp").d(message);
  }
});

Warning: The logs generated by this interceptor when using the HEADERS or BODY levels has the potential to leak sensitive information such as "Authorization" or "Cookie" headers and the contents of request and response bodies. This data should only be logged in a controlled way or in a non-production environment.

Download

Get via Maven:

<dependency>
  <groupId>com.squareup.okhttp</groupId>
  <artifactId>logging-interceptor</artifactId>
  <version>(insert latest version)</version>
</dependency>

or via Gradle

compile 'com.squareup.okhttp:logging-interceptor:(insert latest version)'