Parcourir la source

Fix macro as suggested in #1548

Marcel Stör il y a 7 ans
Parent
commit
c54bc05ba6
1 fichiers modifiés avec 6 ajouts et 4 suppressions
  1. 6 4
      app/http/httpclient.h

+ 6 - 4
app/http/httpclient.h

@@ -10,16 +10,18 @@
 #ifndef __HTTPCLIENT_H__
 #define __HTTPCLIENT_H__
 
-#if defined(GLOBAL_DEBUG_ON)
+static const char log_prefix[] = "HTTP client: ";
+
+#if defined(DEVELOP_VERSION)
   #define HTTPCLIENT_DEBUG_ON
 #endif
 #if defined(HTTPCLIENT_DEBUG_ON)
-  #define HTTPCLIENT_DEBUG(format, ...) dbg_printf("HTTP client: "format"\n", ##__VA_ARGS__)
+  #define HTTPCLIENT_DEBUG(format, ...) dbg_printf("%s"format"\n", log_prefix, ##__VA_ARGS__)
 #else
-  #define HTTPCLIENT_DEBUG(format, ...)
+  #define HTTPCLIENT_DEBUG(...)
 #endif
 #if defined(NODE_ERROR)
-  #define HTTPCLIENT_ERR(format, ...) NODE_ERR("HTTP client: "format"\n", ##__VA_ARGS__)
+  #define HTTPCLIENT_ERR(format, ...) NODE_ERR("%s"format"\n", log_prefix, ##__VA_ARGS__)
 #else
   #define HTTPCLIENT_ERR(...)
 #endif