diff options
| author | armink <[email protected]> | 2019-03-06 17:07:15 +0800 |
|---|---|---|
| committer | armink <[email protected]> | 2019-03-06 17:54:30 +0800 |
| commit | 0d7ba79219f939ad0dc55eb70872e11c950b0da8 (patch) | |
| tree | fe8f73a1822d3cdbdd939159023023d9dff3a882 /include | |
| parent | 85a0aaa3c2dc2f563ca25a91a00c033eddbb78d2 (diff) | |
Remove the DBG_COLOR and DBG_ENABLE definition.
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdbg.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/rtdbg.h b/include/rtdbg.h index 9036a0cd66..97845321e7 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -19,16 +19,12 @@ * header file. * * #define DBG_SECTION_NAME "MOD" - * #define DBG_ENABLE // enable debug macro * #define DBG_LEVEL DBG_INFO - * #include <rtdbg.h> // must after of DEBUG_ENABLE or some other options + * #include <rtdbg.h> // must after of DBG_LEVEL, DBG_SECTION_NAME or other options * * Then in your C/C++ file, you can use LOG_X macro to print out logs: * LOG_D("this is a debug log!"); * LOG_E("this is a error log!"); - * - * If you want to use different color for different kinds log, you can - * #define DBG_COLOR */ #ifndef RT_DBG_H__ @@ -36,6 +32,16 @@ #include <rtconfig.h> +/* the debug log will force enable when RT_DEBUG macro is defined */ +#if defined(RT_DEBUG) && !defined(DBG_ENABLE) +#define DBG_ENABLE +#endif + +/* it will force output color log when RT_DEBUG_COLOR macro is defined */ +#if defined(RT_DEBUG_COLOR) && !defined(DBG_COLOR) +#define DBG_COLOR +#endif + #if defined(RT_USING_ULOG) && defined(DBG_ENABLE) /* using ulog compatible with rtdbg */ #include <ulog.h> |
