Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.1 Logcat prefix not always showing and breaking pretty logger

Since the new version of Android Studio (3.1) the Logcat window doesn't always show the prefix (03-28 12:43:01.091 nl.test.app D/log). I made my own logger, which prints in a pretty way, but this gets broken since some lines are no longer with the same indentation. I'll show an example below.

03-28 12:43:01.091 nl.test.app D/log: ╔═══════════════════════════════════════════════════════════════════════════════════════     ║ [ (TestActivity.kt:33)#OnCreate ]      ║ This is my test log 03-28 12:43:01.092 nl.test.app D/log: ║ This is my second test log     ╚═══════════════════════════════════════════════════════════════════════════════════════ 

This is how it used to be:

03-28 12:43:01.091 nl.test.app D/log: ╔═══════════════════════════════════════════════════════════════════════════════════════ 03-28 12:43:01.091 nl.test.app D/log: ║ [ (TestActivity.kt:33)#OnCreate ]  03-28 12:43:01.091 nl.test.app D/log: ║ This is my test log 03-28 12:43:01.092 nl.test.app D/log: ║ This is my second test log 03-28 12:43:01.092 nl.test.app D/log: ╚═══════════════════════════════════════════════════════════════════════════════════════ 

Is there a way I can fix this?

like image 816
Kevin van Mierlo Avatar asked Mar 28 '18 12:03

Kevin van Mierlo


People also ask

Why is my Logcat not showing anything in Android?

Solution 1: Restarting your Android StudioIn your IDE Go to File > Invalidate Caches and Restart > Invalidate and Restart. This Solution will clear all the caches of Android studio IDE and restart it automatically, By the method, there are 80% change that Logcat will start work as before.

How do I stop Logcat from clearing?

Prevent clearing the log when the app crashes By default when the app got crashed the logcat clear's in the android studio. To prevent this, click the right end chooser(Filter Configuration chooser) in the logcat tab then select Edit Filter Configuration option and enter current app name and package name.

Can not find Logcat in Android Studio?

Go to Project Structure -> Facets -> “+” -> Android -> Select Project Logcat should now be visible.


1 Answers

According to the issue tracker (https://issuetracker.google.com/issues/77305804) it is fixed and is planned for Android Studio 3.2. To quote from the issue tracker:

This change in behavior was inadvertent and I reverted it. The fix will go out in 3.2.

It does not say when this version will be released. But I'll update my answer as soon as I know.

Edit

Android Studio 3.2 is released and my pretty logger is working again!

like image 81
Kevin van Mierlo Avatar answered Nov 08 '22 11:11

Kevin van Mierlo