Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output logs to logcat on android #927

Open
nitanmarcel opened this issue Aug 23, 2024 · 2 comments
Open

Output logs to logcat on android #927

nitanmarcel opened this issue Aug 23, 2024 · 2 comments

Comments

@nitanmarcel
Copy link

Is there a way to make the logs (verbose/errors) also be printed to android logcat using something like __android_log_vprint ?

@fouzul-hassan
Copy link

the general approach you can take to integrate __android_log_vprint with mimalloc:

  1. 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.

  2. 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.

  3. Use Conditional Compilation: Use #ifdef or #if defined to conditionally compile code that uses __android_log_vprint only when building for Android.

@nitanmarcel
Copy link
Author

the general approach you can take to integrate __android_log_vprint with mimalloc:

  1. 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.
  2. 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.
  3. 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

#928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants