diff --git a/README.md b/README.md index 9b1226f..220f50e 100644 --- a/README.md +++ b/README.md @@ -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' } ```` diff --git a/dependencies.gradle b/dependencies.gradle index 97fa928..b263899 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -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', diff --git a/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt b/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt index 6b04d56..d6a6e46 100644 --- a/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt +++ b/log-grpc/src/main/java/com/kernel/finch/networklog/grpc/FinchClientInterceptor.kt @@ -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) @@ -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) diff --git a/sample/build.gradle b/sample/build.gradle index 6c57b12..ef5da8e 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -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")