Merge pull request #2786 from cconlon/android-debug

add Android debug for logcat
This commit is contained in:
toddouska
2020-02-13 10:12:40 -08:00
committed by GitHub

View File

@@ -218,6 +218,8 @@ void WOLFSSL_TIME(int count)
#elif defined(WOLFSSL_TELIT_M2MB) #elif defined(WOLFSSL_TELIT_M2MB)
#include <stdio.h> #include <stdio.h>
#include "m2m_log.h" #include "m2m_log.h"
#elif defined(WOLFSSL_ANDROID_DEBUG)
#include <android/log.h>
#else #else
#include <stdio.h> /* for default printf stuff */ #include <stdio.h> /* for default printf stuff */
#endif #endif
@@ -260,6 +262,8 @@ static void wolfssl_log(const int logLevel, const char *const logMessage)
printk("%s\n", logMessage); printk("%s\n", logMessage);
#elif defined(WOLFSSL_TELIT_M2MB) #elif defined(WOLFSSL_TELIT_M2MB)
M2M_LOG_INFO("%s\n", logMessage); M2M_LOG_INFO("%s\n", logMessage);
#elif defined(WOLFSSL_ANDROID_DEBUG)
__android_log_print(ANDROID_LOG_VERBOSE, "[wolfSSL]", "%s", logMessage);
#else #else
fprintf(stderr, "%s\n", logMessage); fprintf(stderr, "%s\n", logMessage);
#endif #endif