ui/app: use log level info for stderr

It's not given that output to stderr is caused by an error
condition.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-07 19:32:26 +02:00
parent ab13a2ee73
commit 3897832842
+4 -4
View File
@@ -22,11 +22,11 @@ import (
func init() { func init() {
// Android's logcat already includes timestamps. // Android's logcat already includes timestamps.
log.SetFlags(log.Flags() &^ log.LstdFlags) log.SetFlags(log.Flags() &^ log.LstdFlags)
logFd(C.ANDROID_LOG_INFO, os.Stdout.Fd()) logFd(os.Stdout.Fd())
logFd(C.ANDROID_LOG_ERROR, os.Stderr.Fd()) logFd(os.Stderr.Fd())
} }
func logFd(prio C.int, fd uintptr) { func logFd(fd uintptr) {
r, w, err := os.Pipe() r, w, err := os.Pipe()
if err != nil { if err != nil {
panic(err) panic(err)
@@ -49,7 +49,7 @@ func logFd(prio C.int, fd uintptr) {
} }
copy(buf, line) copy(buf, line)
buf[len(line)] = 0 buf[len(line)] = 0
C.__android_log_write(prio, tag, cbuf) C.__android_log_write(C.ANDROID_LOG_INFO, tag, cbuf)
} }
// The garbage collector doesn't know that w's fd was dup'ed. // The garbage collector doesn't know that w's fd was dup'ed.
// Avoid finalizing w, and thereby avoid its finalizer closing its fd. // Avoid finalizing w, and thereby avoid its finalizer closing its fd.