I recently updated to the newest version of Android Studio which is currently 3.1.3. I have never had problems with the Logcat and the is my first main project that I have ever worked on with an IDE where I rely so much on the Logcat.
With that said, I am no Logging expert by any means and the answer I am looking for may be a common Logcat type of issue but with my lack of experience I do not know where to start.
Problem:
The Logcat now displays content while sometimes including the Class file name TAG and sometimes not, I don't know if that is the correct terminology?
This creates a very screwy looking, hard-to-follow, flow of content. It happens frequently but the at the same time inconsistently which is driving me crazy and confusing me greatly at times.
This is some code:
FrameLayout framy = (FrameLayout) findViewById(R.id.frame_lay_message_input_parent);
Log.i(TAG, "framy.getMeasuredHeight(): " + framy.getMeasuredHeight() + "****");
framy.addOnLayoutChangeListener(new View.OnLayoutChangeListener()
{
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)
{
Log.i(TAG, "top: " + top + "****");
Log.i(TAG, "oldTop: " + oldTop + "****");
Log.i(TAG, "bottom: " + bottom + "****");
Log.i(TAG, "oldBottom: " + oldBottom + "****");
}
});
This is what the Logcat can output:
I/ConversationActivity: framy.getMeasuredHeight(): 216****
I/ConversationActivity: top: 440****
oldTop: 440****
bottom: 656****
oldBottom: 656****
I/ConversationActivity: top: 440****
oldTop: 440****
bottom: 656****
oldBottom: 656****
I/ConversationActivity: top: 440****
I/ConversationActivity: oldTop: 440****
bottom: 699****
oldBottom: 656****
I/ConversationActivity: top: 440****
I/ConversationActivity: oldTop: 440****
bottom: 779****
oldBottom: 699****
I had a difficult time trying to make the info above look the way it looks in my Logcat but that is close enough I think.
I run the code and then keep pressing some buttons to change the Layout triggering the Listener and you can see sometimes the Logcat prints the TAG and sometimes it doesn't. Sometimes it prints it multiple times in a row and then other times not, even if it's the same exact code.
I figured maybe it was breaking it up visually based on which method is running but there seems to be no pattern which makes it all the more confusing.
Please keep in mind that while it may look like there is a pattern to how the Logcat is outputting what I typed in this post, this is a very simple example and was honestly hard for me to reach a point where I saw a chance to be able to grab the output and post in on this Website in a manner that was even explainable let alone readable.
The simplicity of this example does not accurately represent the scope of the problem...if that makes any sense to anyone?