blob: b6e46174c0d50e5a4bfb8e3009accf9e637f6f2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* 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, 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)
{
fmtsize[uint64_fmt(fmtsize, size)] = 0 ;
a[m++] = " size " ;
a[m++] = fmtsize ;
}
strerr_warnv(a, m) ;
}
|