summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-04-13 10:36:50 +0800
committerGitHub <[email protected]>2019-04-13 10:36:50 +0800
commit5086bca1f77adf0f30b6d493bb2fc7ce1b325ed5 (patch)
tree89cb48115a065516808cc8b0d6402b9924e06c4c /include
parent16e8f34e468bd472a973467435731ad0fdd60251 (diff)
parentfa4d4ab7cf774ccb701d01a6fd1371ce8d9474e9 (diff)
Merge pull request #2568 from armink/fix_rtdbg
Fix rtdbg
Diffstat (limited to 'include')
-rw-r--r--include/rtdbg.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/rtdbg.h b/include/rtdbg.h
index 77382c656b..a2dfbd9697 100644
--- a/include/rtdbg.h
+++ b/include/rtdbg.h
@@ -18,9 +18,9 @@
* In your C/C++ file, enable/disable DEBUG_ENABLE macro, and then include this
* header file.
*
- * #define DBG_SECTION_NAME "MOD"
- * #define DBG_LEVEL DBG_INFO
- * #include <rtdbg.h> // must after of DBG_LEVEL, DBG_SECTION_NAME or other options
+ * #define DBG_TAG "MOD_TAG"
+ * #define DBG_LVL DBG_INFO
+ * #include <rtdbg.h> // must after of DBG_LVL, DBG_TAG 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!");
@@ -53,15 +53,29 @@
#define DBG_INFO 2
#define DBG_LOG 3
+#ifdef DBG_TAG
+#ifndef DBG_SECTION_NAME
+#define DBG_SECTION_NAME DBG_TAG
+#endif
+#else
+/* compatible with old version */
#ifndef DBG_SECTION_NAME
#define DBG_SECTION_NAME "DBG"
#endif
+#endif /* DBG_TAG */
#ifdef DBG_ENABLE
+#ifdef DBG_LVL
+#ifndef DBG_LEVEL
+#define DBG_LEVEL DBG_LVL
+#endif
+#else
+/* compatible with old version */
#ifndef DBG_LEVEL
#define DBG_LEVEL DBG_WARNING
#endif
+#endif /* DBG_LVL */
/*
* The color for terminal (foreground)