summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_log_answer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtipidee/tipidee_log_answer.c')
-rw-r--r--src/libtipidee/tipidee_log_answer.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libtipidee/tipidee_log_answer.c b/src/libtipidee/tipidee_log_answer.c
new file mode 100644
index 0000000..beedb61
--- /dev/null
+++ b/src/libtipidee/tipidee_log_answer.c
@@ -0,0 +1,24 @@
+/* ISC license. */
+
+#include <sys/types.h>
+
+#include <skalibs/uint64.h>
+#include <skalibs/types.h>
+#include <skalibs/strerr.h>
+
+#include <tipidee/log.h>
+
+void tipidee_log_answer (uint32_t v, unsigned int status, off_t size)
+{
+ char fmtstatus[UINT_FMT] ;
+ if (!(v & TIPIDEE_LOG_ANSWER)) return ;
+ fmtstatus[uint_fmt(fmtstatus, status)] = 0 ;
+ if (size)
+ {
+ char fmtsize[UINT64_FMT] ;
+ fmtsize[uint64_fmt(fmtsize, size)] = 0 ;
+ strerr_warni4x("answer ", fmtstatus, " size ", fmtsize) ;
+ }
+ else
+ strerr_warni2x("answer ", fmtstatus) ;
+}