2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

convert tracing into debug logging

This commit is contained in:
Bob Halley 1999-10-22 19:32:49 +00:00
parent 772a802cd0
commit 6fe8621e7f

View File

@ -39,6 +39,7 @@
#include <dns/rdataset.h> #include <dns/rdataset.h>
#include <dns/tsig.h> #include <dns/tsig.h>
#include <dns/view.h> #include <dns/view.h>
#include <dns/log.h>
#include <dst/dst.h> #include <dst/dst.h>
@ -46,24 +47,39 @@
#define DNS_RESOLVER_TRACE #define DNS_RESOLVER_TRACE
#ifdef DNS_RESOLVER_TRACE #ifdef DNS_RESOLVER_TRACE
#define RTRACE(m) printf("res %p: %s\n", res, (m)) #define RTRACE(m) isc_log_write(dns_lctx, \
#define RRTRACE(r, m) printf("res %p: %s\n", (r), (m)) DNS_LOGCATEGORY_RESOLVER, \
#define FCTXTRACE(m) printf("fctx %p: %s\n", fctx, (m)) DNS_LOGMODULE_RESOLVER, \
#define FTRACE(m) printf("fetch %p (fctx %p): %s\n", \ ISC_LOG_DEBUG(1), \
"res %p: %s", res, (m))
#define RRTRACE(r, m) isc_log_write(dns_lctx, \
DNS_LOGCATEGORY_RESOLVER, \
DNS_LOGMODULE_RESOLVER, \
ISC_LOG_DEBUG(1), \
"res %p: %s", (r), (m))
#define FCTXTRACE(m) isc_log_write(dns_lctx, \
DNS_LOGCATEGORY_RESOLVER, \
DNS_LOGMODULE_RESOLVER, \
ISC_LOG_DEBUG(1), \
"fctx %p: %s", fctx, (m))
#define FTRACE(m) isc_log_write(dns_lctx, \
DNS_LOGCATEGORY_RESOLVER, \
DNS_LOGMODULE_RESOLVER, \
ISC_LOG_DEBUG(1), \
"fetch %p (fctx %p): %s", \
fetch, fetch->private, (m)) fetch, fetch->private, (m))
#define QTRACE(m) printf("query %p (res %p fctx %p): %s\n", \ #define QTRACE(m) isc_log_write(dns_lctx, \
query, query->fctx->res, query->fctx, (m)) DNS_LOGCATEGORY_RESOLVER, \
#define QTRACERESULT(m, r) \ DNS_LOGMODULE_RESOLVER, \
printf("query %p (res %p fctx %p): %s, result = %s\n", \ ISC_LOG_DEBUG(1), \
query, query->fctx->res, query->fctx, (m), \ "resquery %p (fctx %p): %s", \
isc_result_totext((r))) query, query->fctx, (m))
#else #else
#define RTRACE(m) #define RTRACE(m)
#define RRTRACE(r, m) #define RRTRACE(r, m)
#define FCTXTRACE(m) #define FCTXTRACE(m)
#define FTRACE(m) #define FTRACE(m)
#define QTRACE(m) #define QTRACE(m)
#define QTRACERESULT(m, r)
#endif #endif
@ -311,8 +327,6 @@ resquery_senddone(isc_task_t *task, isc_event_t *event) {
(void)task; (void)task;
QTRACERESULT("senddone", sevent->result);
if (sevent->result != ISC_R_SUCCESS) if (sevent->result != ISC_R_SUCCESS)
fctx_cancelquery(&query, NULL); fctx_cancelquery(&query, NULL);
@ -2165,13 +2179,11 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
if (keep_trying) { if (keep_trying) {
if (result == DNS_R_FORMERR) if (result == DNS_R_FORMERR)
broken_server = ISC_TRUE; broken_server = ISC_TRUE;
if (broken_server) {
/* /*
* XXXRTH We will mark the sender as bad here instead * XXXRTH If we have a broken server at this poing, we will
* of doing the printf(). * decrease its 'goodness', possibly add a 'lame'
* entry, and maybe log a message.
*/ */
printf("broken server\n");
}
/* /*
* Do we need to find the best nameservers for this fetch? * Do we need to find the best nameservers for this fetch?
*/ */