Skip to content

Commit

Permalink
fix android logger
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Jun 18, 2024
1 parent 3f00d2e commit 2aea41b
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions ww/eventloop/base/hlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,37 +161,22 @@ HV_EXPORT void hv_destroy_default_logger(void);
#include <android/log.h>
#define LOG_TAG "JNI"
static inline void hlogd(const char * fmt, ...){
va_list myargs;
va_start(myargs, fmt);
__android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, myargs);
va_end(myargs);
__android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, fmt, myargs);
}

static inline void hlogi(const char * fmt, ...){
va_list myargs;
va_start(myargs, fmt);
__android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, myargs);
va_end(myargs);
__android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, fmt, myargs);
}

static inline void hlogw(const char * fmt, ...){
va_list myargs;
va_start(myargs, fmt);
__android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, myargs);
va_end(myargs);
__android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, fmt, myargs);
}

static inline void hloge(const char * fmt, ...){
va_list myargs;
va_start(myargs, fmt);
__android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, myargs);
va_end(myargs);
__android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, fmt, fmtmyargs);
}
static inline void hlogf(const char * fmt, ...){
va_list myargs;
va_start(myargs, fmt);
__android_log_vprint(ANDROID_LOG_FATAL, LOG_TAG, myargs);
va_end(myargs);
__android_log_vprint(ANDROID_LOG_FATAL, LOG_TAG, fmt, myargs);
}
#else

Expand Down

0 comments on commit 2aea41b

Please sign in to comment.