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

Many debug message with your library #10

Open
filol opened this issue Apr 12, 2017 · 5 comments
Open

Many debug message with your library #10

filol opened this issue Apr 12, 2017 · 5 comments
Assignees

Comments

@filol
Copy link

filol commented Apr 12, 2017

When I use your library I have a lot of messages of this type (about 20 per second!)
D/TextView: setTypeface with style : 0

I also have a suggestion for you: add an option for hide the logs by default

Android Nougat 7.0 - Samsung Galaxy S7 Edge

@Manabu-GT
Copy link
Owner

Thanks for your comments.

Did you mean the log messages of the following type are only logged when you integrated this library, correct?
D/TextView: setTypeface with style : 0

Also, did you install this library with default options? For example,

public class ExampleApplication extends Application {

  @Override public void onCreate() {
    super.onCreate();
    DebugOverlay.with(this).install();
    // Normal app init code...
  }
}

The issue is new to me since I didn't see that type of log message at all when testing this library with a couple of Xperia and Nexus devices. After I get your response, I will try to re-produce it on Galaxy devices.

@Manabu-GT Manabu-GT self-assigned this Apr 12, 2017
@filol
Copy link
Author

filol commented Apr 12, 2017

Yes I have these logs only when I integrate your library. If I comment the integration nothing more. I get the impression that I have a message like this every time a line is displayed on the overlay (which makes an infinite loop as these lines are also displayed)

No I use customize options here they are :

new DebugOverlay.Builder(this)
                .modules(new LogcatModule(LogcatModule.DEFAULT_MAX_LINES,
                        new LogcatLineFilter.SimpleLogcatLineFilter(LogcatLine.Priority.DEBUG)))
                .position(Position.BOTTOM_START)
                .bgColor(Color.parseColor("#60000000"))
                .textColor(Color.MAGENTA)
                .textSize(14f)
                .textAlpha(.8f)
                .allowSystemLayer(true)
                .notification(true, MainMenu.class.getName())
                .build()
                .install();

Here is an example of the number of logs I have (look at the time each time!)
image

PS : i don't have this problem on emulator

@Manabu-GT
Copy link
Owner

Thanks for your quick response!

I tried to re-produce this issue on my old Galaxy S3 and Note 2, but the attempt was unsuccessful.
I probably try Firebase TestLab later where I can use Samsung Galaxy S7 for testing.
What's weird is that I could not find any code in TextView's implementation available through AOSP which prints out the log message you observed. Not sure if a vendor would add such extra log messages in the TextView. Hmm.

Anyway, you can do something like below meanwhile to avoid seeing the infinite TextView's logs.

new DebugOverlay.Builder(this)
               .modules(new LogcatModule(LogcatModule.DEFAULT_MAX_LINES,
                        new LogcatLineFilter() {
                            @Override
                            public boolean shouldFilterOut(LogcatLine.Priority priority, @NonNull String tag) {
                                return priority.getIntValue() < LogcatLine.Priority.DEBUG.getIntValue() || ("TextView".equals(tag) &&
                                        priority == LogcatLine.Priority.DEBUG);
                            }
                        }))
                .position(Position.BOTTOM_START)
                .bgColor(Color.parseColor("#60000000"))
                .textColor(Color.MAGENTA)
                .textSize(14f)
                .textAlpha(.8f)
                .allowSystemLayer(true)
                .notification(true, MainMenu.class.getName())
                .build()
                .install();

Please let me know if this does not work and I will let you know once I find a better way to avoid this issue.

@filol
Copy link
Author

filol commented Apr 13, 2017

Thank you for your answer, I tried your proposal and it works. It's good for me, if you need more info on the bug or a test don't hesitate!

@jirimracek
Copy link

This comes from calls to
view.setTypeface(Typeface.DEFAULT,0) or view.setTypeface(Typeface.DEFAULT,Typeface.NORMAL)

I believe you can safely change the calls to (omit the second parameter)
view.setTypeface(Typeface.DEFAULT)
(view being a TextView)

Galaxy 7 DUOS (SM-G920FD), Android 7.0

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

No branches or pull requests

3 participants