Sfoglia il codice sorgente

【完善】日志定义,移除头文件中的定义。

Signed-off-by: armink <armink.ztl@gmail.com>
armink 7 anni fa
parent
commit
36136017c3
3 ha cambiato i file con 20 aggiunte e 15 eliminazioni
  1. 0 15
      inc/webclient.h
  2. 10 0
      src/webclient.c
  3. 10 0
      src/webclient_file.c

+ 0 - 15
inc/webclient.h

@@ -27,21 +27,6 @@
 extern "C" {
 #endif   
 
-#undef DBG_SECTION_NAME
-#undef DBG_LEVEL
-#undef DBG_COLOR
-#undef DBG_ENABLE
-
-#define DBG_ENABLE
-#define DBG_SECTION_NAME               "WEB"
-#ifdef WEBCLIENT_DEBUG
-#define DBG_LEVEL                      DBG_LOG
-#else
-#define DBG_LEVEL                      DBG_INFO
-#endif /* WEBCLIENT_DEBUG */
-#define DBG_COLOR
-#include <rtdbg.h>
-
 #ifndef web_malloc
 #define web_malloc                     rt_malloc
 #endif

+ 10 - 0
src/webclient.c

@@ -28,6 +28,16 @@
 #include <lwip/sockets.h>
 #endif /* RT_USING_SAL */
 
+#define DBG_ENABLE
+#define DBG_SECTION_NAME               "web"
+#ifdef WEBCLIENT_DEBUG
+#define DBG_LEVEL                      DBG_LOG
+#else
+#define DBG_LEVEL                      DBG_INFO
+#endif /* WEBCLIENT_DEBUG */
+#define DBG_COLOR
+#include <rtdbg.h>
+
 /* default receive or send timeout */
 #define WEBCLIENT_DEFAULT_TIMEO        6
 

+ 10 - 0
src/webclient_file.c

@@ -17,6 +17,16 @@
 #ifdef RT_USING_DFS
 #include <dfs_posix.h>
 
+#define DBG_ENABLE
+#define DBG_SECTION_NAME               "web.file"
+#ifdef WEBCLIENT_DEBUG
+#define DBG_LEVEL                      DBG_LOG
+#else
+#define DBG_LEVEL                      DBG_INFO
+#endif /* WEBCLIENT_DEBUG */
+#define DBG_COLOR
+#include <rtdbg.h>
+
 /**
  * send GET request and store response data into the file.
  *