mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
a/util: Prepend "monado" to function name on android logcat
For easier searching. Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2232>
This commit is contained in:
parent
d2c4126ba6
commit
fc830bc5b4
|
@ -15,6 +15,7 @@
|
||||||
- mr.1372
|
- mr.1372
|
||||||
- mr.1377
|
- mr.1377
|
||||||
- mr.1385
|
- mr.1385
|
||||||
|
- mr.2232
|
||||||
---
|
---
|
||||||
|
|
||||||
More improvements to the Android port.
|
More improvements to the Android port.
|
||||||
|
|
|
@ -50,6 +50,11 @@
|
||||||
*/
|
*/
|
||||||
#define LOG_HEX_LINE_BUF_SIZE (128)
|
#define LOG_HEX_LINE_BUF_SIZE (128)
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef LOG_ANDROID_TAG_PREFIX
|
||||||
|
#define LOG_ANDROID_TAG_PREFIX "monado"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Global log level functions.
|
* Global log level functions.
|
||||||
|
@ -381,10 +386,15 @@ do_print(const char *file, int line, const char *func, enum u_logging_level leve
|
||||||
|
|
||||||
|
|
||||||
#ifdef XRT_OS_ANDROID
|
#ifdef XRT_OS_ANDROID
|
||||||
|
|
||||||
android_LogPriority prio = u_log_convert_priority(level);
|
android_LogPriority prio = u_log_convert_priority(level);
|
||||||
__android_log_write(prio, func, storage);
|
|
||||||
|
|
||||||
|
char storage_tag[256];
|
||||||
|
int tag_ret = u_truncate_snprintf(storage_tag, sizeof(storage_tag), LOG_ANDROID_TAG_PREFIX ".%s", func);
|
||||||
|
if (tag_ret < 0) {
|
||||||
|
__android_log_write(prio, func, storage);
|
||||||
|
} else {
|
||||||
|
__android_log_write(prio, storage_tag, storage);
|
||||||
|
}
|
||||||
#elif defined XRT_OS_WINDOWS || defined XRT_OS_LINUX
|
#elif defined XRT_OS_WINDOWS || defined XRT_OS_LINUX
|
||||||
|
|
||||||
// We want a newline, so add it, then null-terminate again.
|
// We want a newline, so add it, then null-terminate again.
|
||||||
|
|
Loading…
Reference in a new issue