mirror of
https://github.com/square/okhttp.git
synced 2025-11-27 18:21:14 +03:00
@@ -130,6 +130,10 @@ public final class HttpLoggingInterceptor implements Interceptor {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Level getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
@Override public Response intercept(Chain chain) throws IOException {
|
@Override public Response intercept(Chain chain) throws IOException {
|
||||||
Level level = this.level;
|
Level level = this.level;
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,16 @@ public final class HttpLoggingInterceptorTest {
|
|||||||
url = server.url("/");
|
url = server.url("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test public void levelGetter() {
|
||||||
|
// The default is NONE.
|
||||||
|
assertEquals(Level.NONE, applicationInterceptor.getLevel());
|
||||||
|
|
||||||
|
for (Level level : Level.values()) {
|
||||||
|
applicationInterceptor.setLevel(level);
|
||||||
|
assertEquals(level, applicationInterceptor.getLevel());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test public void setLevelShouldPreventNullValue() {
|
@Test public void setLevelShouldPreventNullValue() {
|
||||||
try {
|
try {
|
||||||
applicationInterceptor.setLevel(null);
|
applicationInterceptor.setLevel(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user