Log header bounds to Android logcat

This commit is contained in:
Joe Julian
2026-04-10 15:32:35 -07:00
parent 5838588fc5
commit b59cf8044b
3 changed files with 30 additions and 2 deletions
@@ -0,0 +1,22 @@
//go:build android
package platform
/*
#cgo CFLAGS: -Werror
#cgo LDFLAGS: -landroid
#include <android/log.h>
#include <stdlib.h>
*/
import "C"
import "unsafe"
func LogInfo(tag, msg string) {
ctag := C.CString(tag)
defer C.free(unsafe.Pointer(ctag))
cmsg := C.CString(msg)
defer C.free(unsafe.Pointer(cmsg))
C.__android_log_write(C.ANDROID_LOG_INFO, ctag, cmsg)
}