Skip to content

Conversation

@waterdropw
Copy link

debug log will disapear if it's called in android app, so this PR add logcat instead of printf.

Comment on lines +121 to +123
#ifdef WHISPER_LOGCAT
#include <android/log.h>
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm not convinced that including <android/log.h> in whisper.cpp is the best approach. It seems more practical to use a callback instead.

I'm also wondering why do we continue to use WHISPER_PRINT_DEBUG when we already have WHISPER_LOG? Couldn't we just create a function named WHISPER_LOG_DEBUG that offers both console output and callback functionality? @ggerganov

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I see the callback logic just now, I agree with you, it's the right way!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, logcat is better to not be part of whisper.cpp - utilize the log callback

Regarding WHISPER_PRINT_DEBUG - it's used for debugging that I don't think will be really useful to the "outside world". But we could add WHISPER_LOG_DEBUG instead for consistency. Probably have to extend enum ggml_log_level with new GGML_LOG_LEVEL_DEBUG value

@bobqianic
Copy link
Collaborator

I am now closing this PR because you can now use a callback to get all the log information, including DEBUG.

@bobqianic bobqianic closed this Dec 23, 2023
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

Successfully merging this pull request may close these issues.

3 participants