Skip to content

Make Sessions logging consistent with Apple SDK #4919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal class EventGDTLogger(private val transportFactoryProvider: Provider<Tra

private fun encode(value: SessionEvent): ByteArray {
val jsonEvent = SessionEvents.SESSION_EVENT_ENCODER.encode(value)
Log.d(TAG, "Encoded Session Start event $jsonEvent")
Log.d(TAG, "Session Event: $jsonEvent")
return jsonEvent.toByteArray()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal constructor(
if (appContext is Application) {
appContext.registerActivityLifecycleCallbacks(sessionInitiator.activityLifecycleCallbacks)
} else {
Log.w(
Log.e(
TAG,
"Failed to register lifecycle callbacks, unexpected context ${appContext.javaClass}."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ internal class SessionCoordinator(
try {
firebaseInstallations.id.await()
} catch (ex: Exception) {
Log.w(TAG, "Session Installations Error", ex)
Log.e(TAG, "Error getting Firebase Installation ID: ${ex}. Using an empty ID")
// Use an empty fid if there is any failure.
""
}

try {
eventGDTLogger.log(sessionEvent)

Log.i(TAG, "Logged Session Start event: ${sessionEvent.sessionData.sessionId}")
Log.i(TAG, "Successfully logged Session Start event: ${sessionEvent.sessionData.sessionId}")
} catch (e: RuntimeException) {
Log.w(TAG, "Failed to log Session Start event: ", e)
Log.e(TAG, "Error logging Session Start event to DataTransport: ", e)
}
}

Expand Down