From 607a9e37c5fd37003453f92c7e833e3d75ba212a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 11 Dec 2023 18:52:09 -0600 Subject: [PATCH] gogio: set gioui.org/app.ID in addition to the log package's appID app.ID is documented to be set by the gogio tool, but never was. Signed-off-by: Elias Naur --- gogio/build_info.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gogio/build_info.go b/gogio/build_info.go index 32d5076..3ef1ca7 100644 --- a/gogio/build_info.go +++ b/gogio/build_info.go @@ -97,6 +97,9 @@ func getLdFlags(appID string) string { ldflags = append(ldflags, strings.Split(extra, " ")...) } // Pass appID along, to be used for logging on platforms like Android. + ldflags = append(ldflags, fmt.Sprintf("-X gioui.org/app.ID=%s", appID)) + // Support earlier Gio versions that had a separate app id recorded. + // TODO: delete this in the future. ldflags = append(ldflags, fmt.Sprintf("-X gioui.org/app/internal/log.appID=%s", appID)) // Pass along all remaining arguments to the app. if appArgs := flag.Args()[1:]; len(appArgs) > 0 {