ex
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca/source/baidu_ca_debug.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TMBOY | 47:9e361da97763 | 1 | // Copyright 2017 Baidu Inc. All Rights Reserved. |
| TMBOY | 47:9e361da97763 | 2 | // Author: Su Hao (suhao@baidu.com) |
| TMBOY | 47:9e361da97763 | 3 | // |
| TMBOY | 47:9e361da97763 | 4 | // Description: The APIs for debug the programs. |
| TMBOY | 47:9e361da97763 | 5 | |
| TMBOY | 47:9e361da97763 | 6 | #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_DEBUG_H |
| TMBOY | 47:9e361da97763 | 7 | #define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_DEBUG_H |
| TMBOY | 47:9e361da97763 | 8 | |
| TMBOY | 47:9e361da97763 | 9 | #include "baidu_ca_types.h" |
| TMBOY | 47:9e361da97763 | 10 | //TODO this file don't need any more see duer_log.h |
| TMBOY | 47:9e361da97763 | 11 | /* |
| TMBOY | 47:9e361da97763 | 12 | * debug function |
| TMBOY | 47:9e361da97763 | 13 | * |
| TMBOY | 47:9e361da97763 | 14 | * @Param level, in, void *, debug level |
| TMBOY | 47:9e361da97763 | 15 | * @Param file, in, const char *, debug file |
| TMBOY | 47:9e361da97763 | 16 | * @Param line, in, bca_u32_t, debug file line |
| TMBOY | 47:9e361da97763 | 17 | * @Param msg, in, debug message |
| TMBOY | 47:9e361da97763 | 18 | */ |
| TMBOY | 47:9e361da97763 | 19 | //BCA_INT void bca_debug_print(bca_u32_t level, const char* file, |
| TMBOY | 47:9e361da97763 | 20 | // bca_u32_t line, const char* msg); |
| TMBOY | 47:9e361da97763 | 21 | |
| TMBOY | 47:9e361da97763 | 22 | /* |
| TMBOY | 47:9e361da97763 | 23 | * debug function |
| TMBOY | 47:9e361da97763 | 24 | * |
| TMBOY | 47:9e361da97763 | 25 | * @Param level, in, void *, debug level |
| TMBOY | 47:9e361da97763 | 26 | * @Param file, in, const char *, debug file |
| TMBOY | 47:9e361da97763 | 27 | * @Param line, in, bca_u32_t, debug file line |
| TMBOY | 47:9e361da97763 | 28 | * @Param fmt, in, debug message print format |
| TMBOY | 47:9e361da97763 | 29 | */ |
| TMBOY | 47:9e361da97763 | 30 | //BCA_INT void bca_debug(bca_u32_t level, const char* file, |
| TMBOY | 47:9e361da97763 | 31 | // bca_u32_t line, const char* fmt, ...); |
| TMBOY | 47:9e361da97763 | 32 | |
| TMBOY | 47:9e361da97763 | 33 | //#ifdef BCA_DEBUG_LEVEL |
| TMBOY | 47:9e361da97763 | 34 | //#define BCA_DEBUG_EXT(_l, _f, _li, ...) bca_debug(_l, _f, _li, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 35 | //#else |
| TMBOY | 47:9e361da97763 | 36 | //#define BCA_DEBUG_EXT(...) |
| TMBOY | 47:9e361da97763 | 37 | //#endif |
| TMBOY | 47:9e361da97763 | 38 | // |
| TMBOY | 47:9e361da97763 | 39 | //#if defined(BCA_DEBUG_LEVEL) && (BCA_DEBUG_LEVEL >= 5) |
| TMBOY | 47:9e361da97763 | 40 | //#define BCA_LOGV_EXT(_f, _l, ...) BCA_DEBUG_EXT(5, _f, _l, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 41 | //#else |
| TMBOY | 47:9e361da97763 | 42 | //#define BCA_LOGV_EXT(...) |
| TMBOY | 47:9e361da97763 | 43 | //#endif |
| TMBOY | 47:9e361da97763 | 44 | // |
| TMBOY | 47:9e361da97763 | 45 | //#if defined(BCA_DEBUG_LEVEL) && (BCA_DEBUG_LEVEL >= 4) |
| TMBOY | 47:9e361da97763 | 46 | //#define BCA_LOGD_EXT(_f, _l, ...) BCA_DEBUG_EXT(4, _f, _l, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 47 | //#else |
| TMBOY | 47:9e361da97763 | 48 | //#define BCA_LOGD_EXT(...) |
| TMBOY | 47:9e361da97763 | 49 | //#endif |
| TMBOY | 47:9e361da97763 | 50 | // |
| TMBOY | 47:9e361da97763 | 51 | //#if defined(BCA_DEBUG_LEVEL) && (BCA_DEBUG_LEVEL >= 3) |
| TMBOY | 47:9e361da97763 | 52 | //#define BCA_LOGI_EXT(_f, _l, ...) BCA_DEBUG_EXT(3, _f, _l, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 53 | //#else |
| TMBOY | 47:9e361da97763 | 54 | //#define BCA_LOGI_EXT(...) |
| TMBOY | 47:9e361da97763 | 55 | //#endif |
| TMBOY | 47:9e361da97763 | 56 | // |
| TMBOY | 47:9e361da97763 | 57 | //#if defined(BCA_DEBUG_LEVEL) && (BCA_DEBUG_LEVEL >= 2) |
| TMBOY | 47:9e361da97763 | 58 | //#define BCA_LOGW_EXT(_f, _l, ...) BCA_DEBUG_EXT(2, _f, _l, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 59 | //#else |
| TMBOY | 47:9e361da97763 | 60 | //#define BCA_LOGW_EXT(...) |
| TMBOY | 47:9e361da97763 | 61 | //#endif |
| TMBOY | 47:9e361da97763 | 62 | // |
| TMBOY | 47:9e361da97763 | 63 | //#if defined(BCA_DEBUG_LEVEL) && (BCA_DEBUG_LEVEL >= 1) |
| TMBOY | 47:9e361da97763 | 64 | //#define BCA_LOGE_EXT(_f, _l, ...) BCA_DEBUG_EXT(1, _f, _l, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 65 | //#else |
| TMBOY | 47:9e361da97763 | 66 | //#define BCA_LOGE_EXT(...) |
| TMBOY | 47:9e361da97763 | 67 | //#endif |
| TMBOY | 47:9e361da97763 | 68 | // |
| TMBOY | 47:9e361da97763 | 69 | //#if defined(BCA_DEBUG_LEVEL) && (BCA_DEBUG_LEVEL >= 0) |
| TMBOY | 47:9e361da97763 | 70 | //#define BCA_LOGWTF_EXT(_f, _l, ...) BCA_DEBUG_EXT(0, _f, _l, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 71 | //#else |
| TMBOY | 47:9e361da97763 | 72 | //#define BCA_LOGWTF_EXT(...) |
| TMBOY | 47:9e361da97763 | 73 | //#endif |
| TMBOY | 47:9e361da97763 | 74 | // |
| TMBOY | 47:9e361da97763 | 75 | //#define BCA_DEBUG(_l, ...) BCA_DEBUG_EXT(_l, __FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 76 | //#define BCA_LOGV(...) BCA_LOGV_EXT(__FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 77 | //#define BCA_LOGD(...) BCA_LOGD_EXT(__FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 78 | //#define BCA_LOGI(...) BCA_LOGI_EXT(__FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 79 | //#define BCA_LOGW(...) BCA_LOGW_EXT(__FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 80 | //#define BCA_LOGE(...) BCA_LOGE_EXT(__FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 81 | //#define BCA_LOGWTF(...) BCA_LOGWTF_EXT(__FILE__, __LINE__, __VA_ARGS__) |
| TMBOY | 47:9e361da97763 | 82 | |
| TMBOY | 47:9e361da97763 | 83 | #endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_DEBUG_H |
