summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_log_start.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-10-10 08:06:46 +0000
committerLaurent Bercot <ska@appnovation.com>2023-10-10 08:06:46 +0000
commit541325d00c7078d063ea97333d3c9c64d6b6c7b6 (patch)
tree86453b9f547359546d74988b04ab33ec10b4000c /src/libtipidee/tipidee_log_start.c
parentd9f5cb7a28ee79e299e41d3ce325171f01e1a3d7 (diff)
downloadtipidee-541325d00c7078d063ea97333d3c9c64d6b6c7b6.tar.xz
Add new logging functions, change method_conv for bsearch
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libtipidee/tipidee_log_start.c')
-rw-r--r--src/libtipidee/tipidee_log_start.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libtipidee/tipidee_log_start.c b/src/libtipidee/tipidee_log_start.c
new file mode 100644
index 0000000..34284af
--- /dev/null
+++ b/src/libtipidee/tipidee_log_start.c
@@ -0,0 +1,25 @@
+/* ISC license. */
+
+#include <stddef.h>
+
+#include <skalibs/strerr.h>
+
+#include <tipidee/log.h>
+
+void tipidee_log_start (uint32_t v, char const *ip, char const *host)
+{
+ char const *a[5] = { "info: start" } ;
+ size_t m = 1 ;
+ if (!(v & TIPIDEE_LOG_START)) return ;
+ if (v & TIPIDEE_LOG_CLIENTIP)
+ {
+ a[m++] = " ip " ;
+ a[m++] = ip ;
+ }
+ if (v & TIPIDEE_LOG_CLIENTHOST)
+ {
+ a[m++] = " host " ;
+ a[m++] = host ;
+ }
+ strerr_warnv(a, m) ;
+}