Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created November 9, 2025 07:32
Show Gist options
  • Select an option

  • Save skydoves/7653ed29af68b21023be531dccfc55a9 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/7653ed29af68b21023be531dccfc55a9 to your computer and use it in GitHub Desktop.
customlogger
val tagsToLog = setOf("checkout", "product-list", "search")
ComposeStabilityAnalyzer.setLogger(object : RecompositionLogger {
override fun log(event: RecompositionEvent) {
if (BuildConfig.DEBUG) {
// In debug, log everything
Log.d("Recomposition", formatEvent(event))
} else {
// In release, only log tagged composables that exceed threshold
if (event.tag in tagsToLog && event.recompositionCount >= 5) {
// Send to analytics
FirebaseAnalytics.getInstance(this).logEvent("recomposition_issue", ...)
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment