mirror of
https://github.com/square/okhttp.git
synced 2025-11-24 18:41:06 +03:00
Make logging more consistent throughout OkHttp.
Avoid using System.out. Use the best logging implementation on the host platform. On Java this is java.util.logging. On Android it's Android.util.Log. Closes https://github.com/square/okhttp/issues/2505
This commit is contained in:
@@ -35,6 +35,8 @@ import okhttp3.internal.http.HttpEngine;
|
||||
import okio.Buffer;
|
||||
import okio.BufferedSource;
|
||||
|
||||
import static okhttp3.internal.Platform.INFO;
|
||||
|
||||
/**
|
||||
* An OkHttp interceptor which logs request and response information. Can be applied as an
|
||||
* {@linkplain OkHttpClient#interceptors() application interceptor} or as a {@linkplain
|
||||
@@ -107,7 +109,7 @@ public final class HttpLoggingInterceptor implements Interceptor {
|
||||
/** A {@link Logger} defaults output appropriate for the current platform. */
|
||||
Logger DEFAULT = new Logger() {
|
||||
@Override public void log(String message) {
|
||||
Platform.get().log(message);
|
||||
Platform.get().log(INFO, message, null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user