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.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/libtipidee/tipidee_log_answer.c b/src/libtipidee/tipidee_log_answer.c
index beedb61..b6e4617 100644
--- a/src/libtipidee/tipidee_log_answer.c
+++ b/src/libtipidee/tipidee_log_answer.c
@@ -8,17 +8,26 @@
#include <tipidee/log.h>
-void tipidee_log_answer (uint32_t v, unsigned int status, off_t size)
+void tipidee_log_answer (uint32_t v, tipidee_rql const *rql, unsigned int status, off_t size)
{
+ char const *a[6] = { PROG, ": info:" } ;
+ size_t m = 2 ;
char fmtstatus[UINT_FMT] ;
+ char fmtsize[UINT64_FMT] ;
if (!(v & TIPIDEE_LOG_ANSWER)) return ;
+ if (v & TIPIDEE_LOG_HOSTASPREFIX)
+ {
+ a[m++] = " host " ;
+ a[m++] = rql->uri.host ;
+ }
fmtstatus[uint_fmt(fmtstatus, status)] = 0 ;
+ a[m++] = " answer " ;
+ a[m++] = fmtstatus ;
if (size)
{
- char fmtsize[UINT64_FMT] ;
fmtsize[uint64_fmt(fmtsize, size)] = 0 ;
- strerr_warni4x("answer ", fmtstatus, " size ", fmtsize) ;
+ a[m++] = " size " ;
+ a[m++] = fmtsize ;
}
- else
- strerr_warni2x("answer ", fmtstatus) ;
+ strerr_warnv(a, m) ;
}