4403f1e8820be1b7e80aa027b76742faff83c9ec
[platform/adaptation/emulator/libtbm-vigs.git] / src / tbm_emulator_log.h
1 #ifndef _TBM_EMULATOR_LOG_H
2 #define _TBM_EMULATOR_LOG_H
3
4 typedef enum
5 {
6     tbm_emulator_log_level_off = 0,
7     tbm_emulator_log_level_error = 1,
8     tbm_emulator_log_level_info = 2,
9     tbm_emulator_log_level_debug = 3,
10 } tbm_emulator_log_level;
11
12 void tbm_emulator_log_event(tbm_emulator_log_level log_level,
13                             const char *func,
14                             int line,
15                             const char *format, ...);
16
17 int tbm_emulator_log_is_debug_enabled();
18
19 #define TBM_EMULATOR_LOG_DEBUG(format, ...) \
20     do { \
21         if (tbm_emulator_log_is_debug_enabled()) { \
22             tbm_emulator_log_event(tbm_emulator_log_level_debug, __FUNCTION__, __LINE__, format,##__VA_ARGS__); \
23         } \
24     } while(0)
25
26 #define TBM_EMULATOR_LOG_INFO(format, ...) tbm_emulator_log_event(tbm_emulator_log_level_info, __FUNCTION__, __LINE__, format,##__VA_ARGS__)
27 #define TBM_EMULATOR_LOG_ERROR(format, ...) tbm_emulator_log_event(tbm_emulator_log_level_error, __FUNCTION__, __LINE__, format,##__VA_ARGS__)
28
29 #endif