Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79511fda authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Update kotlin protologging docs

Make clear that kotlin protologging now works, but that its performance is less optimized than java

Bug: 317337621
Flag: EXEMPT docs only
Change-Id: I55452819258c67304a16e52e42fd75f7c9623580
parent 304e8072
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -28,13 +28,11 @@ building to check the log state (is enabled) before printing the print format st
  traces in Winscope)

### Kotlin
Kotlin protologging is supported but not as optimized as in Java.

The Protolog tool does not yet have support for Kotlin code ([b/168581922](https://b.corp.google.com/issues/168581922)).

What this implies is that ProtoLogs are not pre-processed to extract the static strings out when used in Kotlin. So,
there is no memory gain when using ProtoLogging in Kotlin. The logs will still be traced to Perfetto, but with a subtly
worse performance due to the additional string interning that needs to be done at run time instead of at build time.
Kotlin protologging is supported, but with some differences compared to Java. The ProtoLog tool
currently does not process Kotlin code. This means that while ProtoLogs in Kotlin will still be
traced to Perfetto, they are not pre-processed to extract static strings like in Java. Consequently,
using ProtoLogging in Kotlin does not provide the same memory gains as in Java, and log calls may be
slightly less performant due to additional string interning at runtime.

### Enabling ProtoLog command line logging
Run these commands to enable protologs (in logcat) for WM Core ([list of all core tags](/core/java/com/android/internal/protolog/ProtoLogGroup.java)):