Skip to content
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

Provide a way to disable all notifications #2394

Closed
sahil2441 opened this issue Jun 28, 2022 · 3 comments · Fixed by #2440
Closed

Provide a way to disable all notifications #2394

sahil2441 opened this issue Jun 28, 2022 · 3 comments · Fixed by #2440

Comments

@sahil2441
Copy link
Contributor

sahil2441 commented Jun 28, 2022

Background
We enabled Leakcanary on internal builds in our company recently. These internal builds are used by all employees - including non-developers. Leak canary does a really good job of providing visibility around what it's doing via notifications such as - getting a heap dump, parsing it, telling how many objects are retained, whether retained object are GC-ed etc.
However, these notifications are not very much useful in internal non-dev builds mainly because several non-devs have little to no context around leak canary and what it does. The notifications appeared to be too noisy and we had to eventually disable it.

Our goal is to let Leakcanary run silently in the background and continue to find memory leaks without any interruptions.

Progress So Far
So far I've been able to mute most of the notifications by setting Leakcanary.config with:

            LeakCanary.config.eventListeners.filter {
                it !is ToastEventListener && it !is LazyForwardingEventListener
            }

However, I'm seeing more Leakcanary notifications such as: leakcanary.internal.HeapDumpTrigger#showNoMoreRetainedObjectNotification

We should explore ways to mute all notifications in LeakCanary.

from @pyricau :

We should provide a way to disable notifications using EventListeners.
We could also explore to override a global flag something on the lines of: leakcanary.internal.Notifications#getCanShowNotification which can disable all the notifications.

@pyricau
Copy link
Member

pyricau commented Jun 28, 2022

Can you tell me more about your use case, and why you want to remove all notifications?

@sahil2441
Copy link
Contributor Author

Thanks @pyricau. I updated the description.

@pyricau
Copy link
Member

pyricau commented Jun 28, 2022

Thanks, makes sense. Seems like a valid need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants