Log header bounds to Android logcat
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
package platform
|
package platform
|
||||||
|
|
||||||
|
import "log"
|
||||||
|
|
||||||
func NewVaultSharer(goos string) VaultSharer {
|
func NewVaultSharer(goos string) VaultSharer {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LogInfo(tag, msg string) {
|
||||||
|
log.Printf("%s: %s", tag, msg)
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -18,6 +17,7 @@ import (
|
|||||||
"gioui.org/widget"
|
"gioui.org/widget"
|
||||||
"gioui.org/widget/material"
|
"gioui.org/widget/material"
|
||||||
editormodel "git.julianfamily.org/keepassgo/internal/appui/editor"
|
editormodel "git.julianfamily.org/keepassgo/internal/appui/editor"
|
||||||
|
"git.julianfamily.org/keepassgo/internal/appui/platform"
|
||||||
settingsmodel "git.julianfamily.org/keepassgo/internal/appui/settings"
|
settingsmodel "git.julianfamily.org/keepassgo/internal/appui/settings"
|
||||||
"git.julianfamily.org/keepassgo/internal/vault"
|
"git.julianfamily.org/keepassgo/internal/vault"
|
||||||
)
|
)
|
||||||
@@ -305,7 +305,7 @@ func (u *ui) maybeLogHeaderBounds(bounds headerButtonBounds) {
|
|||||||
if line == u.lastHeaderBoundsLog {
|
if line == u.lastHeaderBoundsLog {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Print(line)
|
platform.LogInfo("KeePassGO", line)
|
||||||
u.lastHeaderBoundsLog = line
|
u.lastHeaderBoundsLog = line
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user