//go:build android
// +build android

package Android

/*
#cgo CFLAGS: -Wno-incompatible-pointer-types
#include <jni.h>
#include <android/log.h>
#include <stdlib.h>

static void go_log_error(const char* msg) {
    __android_log_print(ANDROID_LOG_ERROR, "SunnyNetTun", "%s", msg);
}
*/
import "C"
import "fmt"
import "unsafe"

func LOG_ERROR(format string, args ...any) {
	msg := fmt.Sprintf(format, args...)
	C1 := C.CString(msg)
	defer C.free(unsafe.Pointer(C1))
	C.go_log_error(C1)
}
