Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/leakcanary/LeakCanary/Config/eventListeners

eventListeners

[androidJvm]\ val eventListeners: List<EventListener>

Listeners for LeakCanary events. See EventListener.Event for the list of events and which thread they’re sent from. You most likely want to keep this list and add to it, or remove a few entries but not all entries. Each listener is independent and provides additional behavior which you can disable by not excluding it:

// No cute canary toast (very sad!)
LeakCanary.config = LeakCanary.config.run {
  copy(
    eventListeners = eventListeners.filter {
      it !is ToastEventListener
    }
  )
}