Commit Graph

4 Commits

Author SHA1 Message Date
Elias Naur 662cd2e97a app/internal/log: [Android] don't truncate log lines
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-02 16:13:35 +02:00
Daniel Martí e97adeedd9 app/internal/log: use the app ID as the Android log tag
This way, a Gio app's logs can be filtered uniquely, which wasn't
possible before since the tag "gio" would be the same between gio apps.

Since the app ID is supplied at build time, inject it via a variable
with the linker's help. The variable is only used on Android for now,
but that's OK. It might be useful for other platforms or other internal
packages in the future.

Fixes #84.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-06 08:41:04 +02:00
Elias Naur 4bde9fbcaa app/internal/log: add synchronized logger on Android
By default, the standard library log package outputs to stderr.
However, stderr is redirected through a pipe to the Android logger,
so recent writes may be not have been sent when os.Exit is called.

The log.Fatal family of functions does just that: write to the log
and call os.Exit.

To ensure all messages are sent, register a synchronized logger at
startup.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-04-29 10:03:07 +02:00
Elias Naur b30bf3cef8 app/internal/log: extract log setup to separate package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-14 16:39:32 +02:00