mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 06:12:55 +00:00
Support logging debug information to logcat on Android.
This commit is contained in:
+26
-2
@@ -3,10 +3,31 @@
|
||||
|
||||
//#define DEBUG_ENABLED
|
||||
|
||||
#ifdef ANDROID
|
||||
|
||||
#include <android/log.h>
|
||||
#define LOG_TAG "eSpeak"
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
#define ENTER(text) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, text)
|
||||
#define SHOW(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
|
||||
#else
|
||||
#define ENTER(text)
|
||||
#define SHOW(format,...)
|
||||
#endif
|
||||
|
||||
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
||||
#define SHOW_TIME(text)
|
||||
|
||||
#else
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
|
||||
#define ENTER(text) debug_enter(text)
|
||||
#define SHOW(format,...) debug_show(format,__VA_ARGS__);
|
||||
#define LOGE(format,...) debug_show(format,__VA_ARGS__);
|
||||
#define SHOW_TIME(text) debug_time(text);
|
||||
|
||||
extern void debug_enter(const char* text);
|
||||
extern void debug_show(const char* format,...);
|
||||
extern void debug_time(const char* text);
|
||||
@@ -15,12 +36,15 @@ extern void debug_time(const char* text);
|
||||
|
||||
#ifdef NO_VARIADIC_MACROS
|
||||
#define SHOW(format) // VC6 doesn't allow "..."
|
||||
#define LOGE(format) // VC6 doesn't allow "..."
|
||||
#else
|
||||
#define SHOW(format,...)
|
||||
#define LOGE(format,...)
|
||||
#endif
|
||||
|
||||
#define SHOW_TIME(text)
|
||||
#define ENTER(text)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user