1 #ifndef _INFRA_LOG_H_ 2 #define _INFRA_LOG_H_ 3 4 #include <stdarg.h> 5 #include "linkkit/infra/infra_defs.h" 6 #include "linkkit/wrappers/wrappers.h" 7 #include <ulog/ulog.h> 8 9 #define LITE_printf printf 10 #define LITE_snprintf snprintf 11 #define LITE_vsnprintf vsnprintf 12 #define LOG_NONE_LEVEL (0) /* no log printed at all */ 13 #define LOG_CRIT_LEVEL (1) /* current application aborting */ 14 #define LOG_ERR_LEVEL (2) /* current app-module error */ 15 #define LOG_WARNING_LEVEL (3) /* using default parameters */ 16 #define LOG_INFO_LEVEL (4) /* running messages */ 17 #define LOG_DEBUG_LEVEL (5) /* debugging messages */ 18 #define LOG_FLOW_LEVEL (6) /* code/packet flow messages */ 19 20 #define log_multi_line(level, title, fmt, payload, mark) 21 #define HEXDUMP_DEBUG(buf, len) 22 #define HEXDUMP_INFO(buf, len) 23 24 #if defined(INFRA_LOG) && !defined(INFRA_LOG_ALL_MUTED) 25 #define log_flow(mod, ...) 26 27 #if defined(INFRA_LOG_MUTE_DBG) 28 #define log_debug(mod, ...) 29 #else 30 #define log_debug(mod, ...) 31 #endif 32 33 #if defined(INFRA_LOG_MUTE_INF) 34 #define log_info(mod, ...) 35 #else 36 #define log_info(mod, ...) 37 #endif 38 39 #if defined(INFRA_LOG_MUTE_WRN) 40 #define log_warning(mod, ...) 41 #else 42 #define log_warning(mod, ...) 43 #endif 44 45 #if defined(INFRA_LOG_MUTE_ERR) 46 #define log_err(mod, ...) 47 #else 48 #define log_err(mod, ...) 49 #endif 50 51 #if defined(INFRA_LOG_MUTE_CRT) 52 #define log_crit(mod, ...) 53 #else 54 #define log_crit(mod, ...) 55 #endif 56 #else /* #if defined(INFRA_LOG) */ 57 58 #define log_flow(mod, ...) 59 #define log_debug(mod, ...) 60 #define log_info(mod, ...) 61 #define log_warning(mod, ...) 62 #define log_err(mod, ...) 63 #define log_crit(mod, ...) 64 65 #endif 66 #endif 67