From aee11fe873c11d5795b03b726bdb274fa7fe0d8a Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Thu, 18 May 2023 15:21:32 -0700 Subject: [PATCH] Add info about logging in Kotlin classes Update readme to include a section about using ProtoLog in Kotlin. And link to the KtProtoLog class. Bug: 283316916 Test: n/a Change-Id: I08bb4cee260e44923a941ced5e26062eff1a9ff7 --- .../Shell/src/com/android/wm/shell/docs/debugging.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md b/libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md index 99922fbc2d954..c795a0595087b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md @@ -26,6 +26,12 @@ building to check the log state (is enabled) before printing the print format st - Non-text ProtoLogs are not currently supported with the Shell library (you can't view them with traces in Winscope) +### Kotlin + +Protolog tool does not yet have support for Kotlin code (see [b/168581922](https://b.corp.google.com/issues/168581922)). +For logging in Kotlin, use the [KtProtoLog](frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/util/KtProtoLog.kt) +class which has a similar API to the Java ProtoLog class. + ### Enabling ProtoLog command line logging Run these commands to enable protologs for both WM Core and WM Shell to print to logcat. ```shell