curl_log: for failf/infof and debug logging implementations

- new functions and macros for cfilter debugging
 - set CURL_DEBUG with names of cfilters where debug logging should be
   enabled
 - use GNUC __attribute__ to enable printf format checks during compile

Closes #10271
This commit is contained in:
Stefan Eissing 2023-01-11 10:30:42 +01:00 committed by Daniel Stenberg
parent 5cf5bfcd13
commit db91dbbf2c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
29 changed files with 656 additions and 466 deletions

View file

@ -26,26 +26,8 @@
#include "curl_setup.h"
void Curl_infof(struct Curl_easy *, const char *fmt, ...);
void Curl_failf(struct Curl_easy *, const char *fmt, ...);
#include "curl_log.h"
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#if defined(HAVE_VARIADIC_MACROS_C99)
#define infof(...) Curl_nop_stmt
#elif defined(HAVE_VARIADIC_MACROS_GCC)
#define infof(x...) Curl_nop_stmt
#else
#error "missing VARIADIC macro define, fix and rebuild!"
#endif
#else /* CURL_DISABLE_VERBOSE_STRINGS */
#define infof Curl_infof
#endif /* CURL_DISABLE_VERBOSE_STRINGS */
#define failf Curl_failf
#define CLIENTWRITE_BODY (1<<0)
#define CLIENTWRITE_HEADER (1<<1)
@ -89,9 +71,4 @@ CURLcode Curl_write_plain(struct Curl_easy *data,
const void *mem, size_t len,
ssize_t *written);
/* the function used to output verbose information */
void Curl_debug(struct Curl_easy *data, curl_infotype type,
char *ptr, size_t size);
#endif /* HEADER_CURL_SENDF_H */