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

add append mode to avoid conflicted getMainLooper().setMessageLogging() #27

Open
markzhai opened this issue Jan 28, 2016 · 11 comments
Open

Comments

@markzhai
Copy link
Owner

Currently BlockCanary directly calls getMainLooper().setMessageLogging() to do monitor, which may conflicts with the original logging set by app, we can add a append mode for those situation.

@markzhai markzhai modified the milestones: 1.1, 1.2 Jan 28, 2016
@markzhai markzhai removed this from the 1.2 milestone Mar 15, 2016
@markzhai
Copy link
Owner Author

@huangqichao currently BlockCanary directly calls getMainLooper().setMessageLogging() to do monitor, if developer's app already used main looper's messageLogging to do something, this will overwrite the original one, thus we need append the MessageLoggin instead of set it.

@YellowQC
Copy link

YellowQC commented Feb 18, 2017

my trouble is : the webview constructor will reset the mainlooper.logging null ,is that means i can't use blockcanary if my project used webview?

@markzhai
Copy link
Owner Author

why does your webview constructor do this?

@YellowQC
Copy link

Not my webview, that's sdk source code. Prehaps google's engineer also did something like monitor the mainlooper performance by this way.

@YellowQC
Copy link

我提出的问题,解决方式是可以在 Application onCreate方法里,在初始化BlockCanary之前,初始化一个WebView,即可。

@suntzu93
Copy link

@huangqichao Did you fixed the issue about Webview ?

@markzhai
Copy link
Owner Author

@thanhlv93 I think he solved it by creating a webview before initialize BlockCanary, maybe you can try this, while I still cannot find where WebView set main thread's looper logging, I still cannot solve this problem, I will appreciate if you can help provide where WebView do this.

@suntzu93
Copy link

@markzhai I'm running as you said set initialize BlockCanary after create a webview. If I find out where does the webview do this , I will let you know .

@YellowQC
Copy link

The webview set the logging null in the native code, and only once! You can add a breakpoint in setMessageLogging and read the trace ,you'll find out where does the webview do this.

@valiantyan
Copy link

大佬,我们项目使用了setMessageLogging是 Looper.getMainLooper().setMessageLogging主线程的 Looper 设置进去的,但是另外一个库也使用了Looper.getMainLooper().setMessageLogging。这钟冲突你说的追加MessageLoggin是什么意思呢,求指导下

@ideav5
Copy link

ideav5 commented Sep 25, 2023 via email

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

No branches or pull requests

6 participants
@markzhai @valiantyan @suntzu93 @ideav5 @YellowQC and others