The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/util: Prepend "monado" to function name on android logcat

For easier searching.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2232>

authored by

Rylie Pavlik and committed by
Marge Bot
fc830bc5 d2c4126b

+13 -2
+1
doc/changes/misc_features/mr.676.md
··· 15 15 - mr.1372 16 16 - mr.1377 17 17 - mr.1385 18 + - mr.2232 18 19 --- 19 20 20 21 More improvements to the Android port.
+12 -2
src/xrt/auxiliary/util/u_logging.c
··· 50 50 */ 51 51 #define LOG_HEX_LINE_BUF_SIZE (128) 52 52 53 + 54 + #ifndef LOG_ANDROID_TAG_PREFIX 55 + #define LOG_ANDROID_TAG_PREFIX "monado" 56 + #endif 57 + 53 58 /* 54 59 * 55 60 * Global log level functions. ··· 381 386 382 387 383 388 #ifdef XRT_OS_ANDROID 384 - 385 389 android_LogPriority prio = u_log_convert_priority(level); 386 - __android_log_write(prio, func, storage); 387 390 391 + char storage_tag[256]; 392 + int tag_ret = u_truncate_snprintf(storage_tag, sizeof(storage_tag), LOG_ANDROID_TAG_PREFIX ".%s", func); 393 + if (tag_ret < 0) { 394 + __android_log_write(prio, func, storage); 395 + } else { 396 + __android_log_write(prio, storage_tag, storage); 397 + } 388 398 #elif defined XRT_OS_WINDOWS || defined XRT_OS_LINUX 389 399 390 400 // We want a newline, so add it, then null-terminate again.