summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-10-12 10:17:47 +0000
committerLaurent Bercot <ska@appnovation.com>2023-10-12 10:17:47 +0000
commit3b0a901275e63ca7a0d46a5f58bdc6d1f706ce06 (patch)
tree4cc508d5b23733117e58547c431abb069621ed65 /src/include
parentd9492e8561fe5373b1428c6d7cff4f25e2796a55 (diff)
downloadtipidee-3b0a901275e63ca7a0d46a5f58bdc6d1f706ce06.tar.xz
New logging system; not used yet in tipideed
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/tipidee/log.h4
1 files changed, 4 insertions, 0 deletions
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 <sys/types.h>
#include <stdint.h>
+#include <skalibs/strerr.h>
#include <skalibs/stralloc.h>
#include <tipidee/rql.h>
@@ -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