Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
kernel0x committed Sep 23, 2024
1 parent 33817a7 commit 4f09830
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ Pick a UI implementation and add the dependency:

````java
dependencies {
debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.11'
releaseImplementation 'com.github.kernel0x.finch:noop:2.2.11'
debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.12'
releaseImplementation 'com.github.kernel0x.finch:noop:2.2.12'
// optional only for OkHttp
debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.11'
releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.11'
debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.12'
releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.12'
// optional only for GRPC
debugImplementation 'com.github.kernel0x.finch:log-grpc:2.2.11'
releaseImplementation 'com.github.kernel0x.finch:log-grpc-noop:2.2.11'
debugImplementation 'com.github.kernel0x.finch:log-grpc:2.2.12'
releaseImplementation 'com.github.kernel0x.finch:log-grpc-noop:2.2.12'
// optional only for logs
debugImplementation 'com.github.kernel0x.finch:log:2.2.11'
releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.11'
debugImplementation 'com.github.kernel0x.finch:log:2.2.12'
releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.12'
}
````

Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext.versions = [
minSdk : 21,
targetSdk : 34,
compileSdk : 34,
libraryVersion : '2.2.11',
libraryVersion : '2.2.12',
libraryVersionCode: 15,

okhttp3 : '3.7.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ internal class FinchClientInterceptor : ClientInterceptor {
responseListener
) {
override fun onMessage(message: RespT) {
val body = if (message == null)
""
else
TextFormat.printer().escapingNonAscii(false)
.printToString(message as MessageOrBuilder)
networkLog.responseBody =
TextFormat.printer().escapingNonAscii(false).printToString(
message as MessageOrBuilder
)
body
networkLog.responseContentLength =
networkLog.responseBody.toByteArray().size.toLong()
FinchGrpcLogger.logNetworkEvent(networkLog)
Expand Down Expand Up @@ -88,9 +91,13 @@ internal class FinchClientInterceptor : ClientInterceptor {
}

override fun sendMessage(message: ReqT) {
networkLog.requestBody = TextFormat.printer().escapingNonAscii(false).printToString(
message as MessageOrBuilder
)
val body = if (message == null)
""
else
TextFormat.printer().escapingNonAscii(false)
.printToString(message as MessageOrBuilder)
networkLog.requestBody =
body
networkLog.requestContentLength =
networkLog.requestBody.toByteArray().size.toLong()
FinchGrpcLogger.logNetworkEvent(networkLog)
Expand Down
12 changes: 6 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ android {
}

dependencies {
//debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.11'
//releaseImplementation 'com.github.kernel0x.finch:noop:2.2.11'
//debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.11'
//releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.11'
//debugImplementation 'com.github.kernel0x.finch:log:2.2.11'
//releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.11'
//debugImplementation 'com.github.kernel0x.finch:ui-drawer:2.2.12'
//releaseImplementation 'com.github.kernel0x.finch:noop:2.2.12'
//debugImplementation 'com.github.kernel0x.finch:log-okhttp:2.2.12'
//releaseImplementation 'com.github.kernel0x.finch:log-okhttp-noop:2.2.12'
//debugImplementation 'com.github.kernel0x.finch:log:2.2.12'
//releaseImplementation 'com.github.kernel0x.finch:log-noop:2.2.12'
debugImplementation project(":ui-drawer")
debugImplementation project(":log")
debugImplementation project(":log-okhttp")
Expand Down

0 comments on commit 4f09830

Please sign in to comment.