diff options
author | Rob Clark <[email protected]> | 2019-09-03 11:43:40 -0700 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-09-06 00:45:11 +0000 |
commit | f9f7cbc1aa36cce6caa42c0cf58c5cbefedc19fd (patch) | |
tree | e618425830c09fb598c6c61ad8cd92e829cad56d /src/util/os_misc.c | |
parent | 9baa72b7fc9989e35f474310ef333c50b2af934a (diff) |
util: android logging support
In particular, it would be nice for failed debug_assert() msgs to show
up in logcat.
Signed-off-by: Rob Clark <[email protected]>
Kristian H. Kristensen <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/util/os_misc.c')
-rw-r--r-- | src/util/os_misc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/os_misc.c b/src/util/os_misc.c index 436bc38604b..e6894731b63 100644 --- a/src/util/os_misc.c +++ b/src/util/os_misc.c @@ -48,7 +48,11 @@ #endif -#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || DETECT_OS_HURD +#if DETECT_OS_ANDROID +# define LOG_TAG "MESA" +# include <unistd.h> +# include <log/log.h> +#elif DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || DETECT_OS_HURD # include <unistd.h> #elif DETECT_OS_APPLE || DETECT_OS_BSD # include <sys/sysctl.h> @@ -104,6 +108,9 @@ os_log_message(const char *message) fflush(stdout); fputs(message, fout); fflush(fout); +# if DETECT_OS_ANDROID + LOG_PRI(ANDROID_LOG_ERROR, LOG_TAG, "%s", message); +# endif #endif } |