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

Cleaner Logging for Android Studio #914

Closed
chrisjdev opened this issue Feb 5, 2020 · 1 comment · Fixed by #950
Closed

Cleaner Logging for Android Studio #914

chrisjdev opened this issue Feb 5, 2020 · 1 comment · Fixed by #950
Labels

Comments

@chrisjdev
Copy link

Feature Request

Only print a console.log message once to the Android Studio Logcat

Motivation Behind Feature

Cleaner logs allow for easier searching (no need to divide by 2 to figure out how many times something has printed), and easier readability while it's running.

Feature Description

I've been mildly annoyed by each console.log message being duplicated in the logs displayed by Logcat and Run tabs in Android Studio for a while. Today, I noticed it's coming from from SystemWebChromeClient.java, onConsoleMessage(). I found that I can enable just one or the other by either only return the super call, or modified to return true instead of the super call. I was hoping it would optionally be controlled by a config item, assuming there's customers for each type of log message. Or maybe no one needs both messages and it can be updated to only log one or the other.

Alternatives or Workarounds

I've heard of some people using a custom regex filter to get to cleaner logs, or using Chrome's debugger.

@breautek breautek added the bug label Apr 12, 2020
@breautek
Copy link
Contributor

I've reproduced this with a simple cordova app running console.log("test"); in the web inspector, which produces the output:

2020-04-11 21:44:15.521 5920-5920/io.cordova.hellocordova D/SystemWebChromeClient: : Line 1 : test
2020-04-11 21:44:15.522 5920-5920/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(1)] "test", source:  (1)

In the logcat. I agree, we can probably remove the logcat print from SystemWebChromeClient.

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

Successfully merging a pull request may close this issue.

2 participants