Fix macro as suggested in #1548

This commit is contained in:
Marcel Stör 2016-11-19 21:17:50 +01:00
parent c70dc7497e
commit c54bc05ba6
1 changed files with 6 additions and 4 deletions

View File

@ -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