After the upgrade to AS 3.1.0, Logcat will merge logs with the same tag within a short period of time, AS shown in the following figure:

Some tripartite log libraries have this problem. AndroidUtilCode, of course, solved this problem right away and now uses only 1.13.8 or later. If AndroidUtilCode is too large, I have a single log library: A streamlined, comprehensive and convenient Android log library: ALog. The output of the previous log is as follows:

Of course, if you still want the same effect as before, I have also made compatible, just need to initialize the following Settings.

setSingleTagSwitch(false)// Only one log is output, which is enabled by default to beautify Logcat 'AS 3.1.0
Copy the code

In passing, let’s talk about the functionality of the logging tool

  • Logcat, compatible with Android Studio 3.1.0, displays logs perfectly
  • Compatible Kotlin
  • Log can be enabled or disabled
  • Configurable output to console (Logcat)
  • You can set the Log global Tag
  • If the global Tag is empty, the Tag is the current class name
  • You can set whether Log displays header information
  • Device information is displayed at the top of the Log file
  • The Log header contains the current thread name
  • Log header contains the current class and line number and function name, support click jump
  • You can set whether Log is written to a file
  • You can set the Log file directory
  • The Log write file prefix can be set
  • Log can be set to display borders
  • The Log console filter can be set
  • You can set the Log file filter
  • You can set the Log stack depth
  • Support output of console master string
  • Supports multi-parameter output
  • Support separate file writing
  • Support JSON string output
  • Supports output of XML strings
  • Support Live Templates

Well, if it helps you, that’s a real coincidence. Welcome to my kennel.