-
Notifications
You must be signed in to change notification settings - Fork 7
/
emb_log.h
36 lines (28 loc) · 1.01 KB
/
emb_log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef EMBRACE_LOG_H
#define EMBRACE_LOG_H
#include <android/log.h>
#define EMB_LOG_TAG "emb_ndk"
#define EMB_DEV_LOG_TAG "emb_ndk_dev"
void emb_enable_dev_logging();
bool emb_dev_logging_enabled();
#ifndef EMB_LOGERROR
#define EMB_LOGERROR(fmt, ...) \
__android_log_print(ANDROID_LOG_ERROR, EMB_LOG_TAG, fmt, ##__VA_ARGS__)
#endif
#ifndef EMB_LOGWARN
#define EMB_LOGWARN(fmt, ...) \
__android_log_print(ANDROID_LOG_WARN, EMB_LOG_TAG, fmt, ##__VA_ARGS__)
#endif
#ifndef EMB_LOGINFO
#define EMB_LOGINFO(fmt, ...) \
__android_log_print(ANDROID_LOG_INFO, EMB_LOG_TAG, fmt, ##__VA_ARGS__)
#endif
#ifndef EMB_LOGDEV
#define EMB_LOGDEV(fmt, ...) \
do { \
if (emb_dev_logging_enabled()) { \
__android_log_print(ANDROID_LOG_ERROR, EMB_DEV_LOG_TAG, fmt, ##__VA_ARGS__); \
} \
} while (0)
#endif
#endif //EMBRACE_LOG_H