From 3b0a901275e63ca7a0d46a5f58bdc6d1f706ce06 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 12 Oct 2023 10:17:47 +0000 Subject: New logging system; not used yet in tipideed Signed-off-by: Laurent Bercot --- src/include/tipidee/log.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include') diff --git a/src/include/tipidee/log.h b/src/include/tipidee/log.h index 29d621f..98e6d0e 100644 --- a/src/include/tipidee/log.h +++ b/src/include/tipidee/log.h @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -20,6 +21,7 @@ #define TIPIDEE_LOG_CLIENTIP 0x0200 #define TIPIDEE_LOG_CLIENTHOST 0x0400 #define TIPIDEE_LOG_HOSTASPREFIX 0x1000 +#define TIPIDEE_LOG_DEBUG 0x10000 #define TIPIDEE_LOG_DEFAULT (TIPIDEE_LOG_REQUEST | TIPIDEE_LOG_ANSWER | TIPIDEE_LOG_SIZE) @@ -39,4 +41,6 @@ extern void tipidee_log_request (uint32_t, tipidee_rql const *, char const *, ch extern void tipidee_log_resource (uint32_t, tipidee_rql const *, char const *, char const *, tipidee_resattr const *) ; extern void tipidee_log_answer (uint32_t, tipidee_rql const *, unsigned int, off_t) ; +#define tipidee_log_debug(v, ...) do { if ((v) & TIPIDEE_LOG_DEBUG) strerr_warn(PROG, ": debug: ", __VA_ARGS__) ; } while (0) + #endif -- cgit v1.3.1