Skip to content

Commit

Permalink
Simplify Android debug logging docs (square#6097)
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke authored May 29, 2020
1 parent 631991d commit dd4cb02
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/debug_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ OkHttpDebugLogging.enableHttp2()
OkHttpDebugLogging.enableTaskRunner()
```

On Android, use [OkHttpDebugLogcat.kt] instead. It connects OkHttp logs to Logcat in Android Studio.
### Activating on Android

```
$ adb shell setprop log.tag.okhttp.Http2 DEBUG
$ adb shell setprop log.tag.okhttp.TaskRunner DEBUG
$ adb logcat '*:E' 'okhttp.Http2:D' 'okhttp.TaskRunner:D'
```

### HTTP/2 Frame Logging

Expand Down Expand Up @@ -53,5 +59,4 @@ This logs task enqueues, starts, and finishes.
[2020-01-01 00:00:00] Q10000 finished run in 739 µs: OkHttp ConnectionPool
```

[OkHttpDebugLogging.kt]: https://github.com/square/okhttp/blob/master/okhttp-testing-support/src/main/java/okhttp3/OkHttpDebugLogging.kt
[OkHttpDebugLogcat.kt]: https://github.com/square/okhttp/blob/master/android-test/src/androidTest/java/okhttp/android/test/OkHttpDebugLogcat.kt
[OkHttpDebugLogging.kt]: https://github.com/square/okhttp/blob/master/okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpDebugLogging.kt

0 comments on commit dd4cb02

Please sign in to comment.