2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Output timestamps in yaml to the microsecond if -u is specified.

This commit is contained in:
Mark Andrews
2020-09-29 14:59:40 +10:00
parent 519b070618
commit 3fe7fa3db2
2 changed files with 48 additions and 4 deletions

View File

@@ -675,15 +675,25 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
if (!isc_time_isepoch(&query->time_sent)) {
char tbuf[100];
isc_time_formatISO8601ms(&query->time_sent, tbuf,
sizeof(tbuf));
if (query->lookup->use_usec) {
isc_time_formatISO8601us(&query->time_sent,
tbuf, sizeof(tbuf));
} else {
isc_time_formatISO8601ms(&query->time_sent,
tbuf, sizeof(tbuf));
}
printf(" query_time: !!timestamp %s\n", tbuf);
}
if (!isquery && !isc_time_isepoch(&query->time_recv)) {
char tbuf[100];
isc_time_formatISO8601ms(&query->time_recv, tbuf,
sizeof(tbuf));
if (query->lookup->use_usec) {
isc_time_formatISO8601us(&query->time_recv,
tbuf, sizeof(tbuf));
} else {
isc_time_formatISO8601ms(&query->time_recv,
tbuf, sizeof(tbuf));
}
printf(" response_time: !!timestamp %s\n", tbuf);
}