Output logs to logcat on android
Is there a way to make the logs (verbose/errors) also be printed to android logcat using something like __android_log_vprint ?
the general approach you can take to integrate __android_log_vprint with mimalloc:
-
Modify the Logging Code in mimalloc: You'll need to adjust the logging functions within the mimalloc source code to use __android_log_vprint when running on an Android platform. This can be done by checking for the Android environment using preprocessor macros.
-
Include the Necessary Android Header: Ensure that the necessary Android headers are included for logging. Typically, this would mean including <android/log.h> in the relevant source files.
-
Use Conditional Compilation: Use #ifdef or #if defined to conditionally compile code that uses __android_log_vprint only when building for Android.
the general approach you can take to integrate __android_log_vprint with mimalloc:
- Modify the Logging Code in mimalloc: You'll need to adjust the logging functions within the mimalloc source code to use __android_log_vprint when running on an Android platform. This can be done by checking for the Android environment using preprocessor macros.
- Include the Necessary Android Header: Ensure that the necessary Android headers are included for logging. Typically, this would mean including <android/log.h> in the relevant source files.
- Use Conditional Compilation: Use #ifdef or #if defined to conditionally compile code that uses __android_log_vprint only when building for Android.
I opened a PR a while ago that does this
https://github.com/microsoft/mimalloc/pull/928