Skip to content

Commit e3af693

Browse files
committed
add logs
1 parent a099493 commit e3af693

File tree

1 file changed

+8
-2
lines changed
  • firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type

1 file changed

+8
-2
lines changed

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveSession.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package com.google.firebase.vertexai.type
1818

1919
import android.media.AudioFormat
2020
import android.media.AudioTrack
21+
import android.util.Log
2122
import com.google.firebase.annotations.concurrent.Background
2223
import io.ktor.client.plugins.websocket.ClientWebSocketSession
2324
import io.ktor.websocket.Frame
@@ -56,6 +57,7 @@ internal constructor(
5657
private var functionCallChannel: Channel<List<FunctionCallPart>> = Channel()
5758

5859
private companion object {
60+
val TAG = LiveSession::class.java.simpleName
5961
val MIN_BUFFER_SIZE =
6062
AudioTrack.getMinBufferSize(
6163
24000,
@@ -279,7 +281,9 @@ internal constructor(
279281
)
280282
)
281283
continue
282-
} catch (_: Exception) {}
284+
} catch (e: Exception) {
285+
Log.i(TAG, "Failed to decode function calling: ${e.message}")
286+
}
283287
try {
284288

285289
val serverContent = Json.decodeFromString<ServerContentSetup.Internal>(receivedJson)
@@ -294,7 +298,9 @@ internal constructor(
294298
emit(LiveContentResponse(data, LiveContentResponse.Status.NORMAL, null))
295299
}
296300
}
297-
} catch (_: Exception) {}
301+
} catch (e: Exception) {
302+
Log.i(TAG, "Failed to decode server content: ${e.message}")
303+
}
298304
}
299305
}
300306
}

0 commit comments

Comments
 (0)