Skip to content

Commit 5628212

Browse files
davidmotsonDavid Motsonashvili
andauthored
Prevent whole session events from logging to logcat (#6551)
Co-authored-by: David Motsonashvili <[email protected]>
1 parent eeb23f7 commit 5628212

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

firebase-sessions/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Unreleased
2+
* [fixed] Removed extraneous logs that risk leaking internal identifiers.
23

34

45
# 2.0.6

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/EventGDTLogger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal class EventGDTLogger(private val transportFactoryProvider: Provider<Tra
5656

5757
private fun encode(value: SessionEvent): ByteArray {
5858
val jsonEvent = SessionEvents.SESSION_EVENT_ENCODER.encode(value)
59-
Log.d(TAG, "Session Event: $jsonEvent")
59+
Log.d(TAG, "Session Event Type: ${value.eventType.name}")
6060
return jsonEvent.toByteArray()
6161
}
6262

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/SessionFirelogPublisher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ internal class SessionFirelogPublisherImpl(
8080
private fun attemptLoggingSessionEvent(sessionEvent: SessionEvent) {
8181
try {
8282
eventGDTLogger.log(sessionEvent)
83-
Log.d(TAG, "Successfully logged Session Start event: ${sessionEvent.sessionData.sessionId}")
83+
Log.d(TAG, "Successfully logged Session Start event.")
8484
} catch (ex: RuntimeException) {
8585
Log.e(TAG, "Error logging Session Start event to DataTransport: ", ex)
8686
}

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/SessionLifecycleClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ internal class SessionLifecycleClient(private val backgroundDispatcher: Coroutin
6868
}
6969

7070
private fun handleSessionUpdate(sessionId: String) {
71-
Log.d(TAG, "Session update received: $sessionId")
71+
Log.d(TAG, "Session update received.")
7272

7373
CoroutineScope(backgroundDispatcher).launch {
7474
FirebaseSessionsDependencies.getRegisteredSubscribers().values.forEach { subscriber ->

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/SessionLifecycleService.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ internal class SessionLifecycleService : Service() {
128128
/** Generates a new session id and sends it everywhere it's needed */
129129
private fun newSession() {
130130
SessionGenerator.instance.generateNewSession()
131-
Log.d(TAG, "Generated new session ${SessionGenerator.instance.currentSession.sessionId}")
131+
Log.d(TAG, "Generated new session.")
132132
broadcastSession()
133133
SessionDatastore.instance.updateSessionId(SessionGenerator.instance.currentSession.sessionId)
134134
}
@@ -138,7 +138,7 @@ internal class SessionLifecycleService : Service() {
138138
* connected clients.
139139
*/
140140
private fun broadcastSession() {
141-
Log.d(TAG, "Broadcasting new session: ${SessionGenerator.instance.currentSession}")
141+
Log.d(TAG, "Broadcasting new session")
142142
SessionFirelogPublisher.instance.logSession(SessionGenerator.instance.currentSession)
143143
// Create a defensive copy because DeadObjectExceptions on send will modify boundClients
144144
val clientsToSend = ArrayList(boundClients)
@@ -151,7 +151,7 @@ internal class SessionLifecycleService : Service() {
151151
} else {
152152
// Send the value from the datastore before the first foregrounding it exists
153153
val storedSession = SessionDatastore.instance.getCurrentSessionId()
154-
Log.d(TAG, "App has not yet foregrounded. Using previously stored session: $storedSession")
154+
Log.d(TAG, "App has not yet foregrounded. Using previously stored session.")
155155
storedSession?.let { sendSessionToClient(client, it) }
156156
}
157157
}

0 commit comments

Comments
 (0)