From 6fe8621e7fa1daaf3bec4f4fb36e17289baef7d4 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 22 Oct 1999 19:32:49 +0000 Subject: [PATCH] convert tracing into debug logging --- lib/dns/resolver.c | 54 ++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index a08780e736..2415b08519 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -46,24 +47,39 @@ #define DNS_RESOLVER_TRACE #ifdef DNS_RESOLVER_TRACE -#define RTRACE(m) printf("res %p: %s\n", res, (m)) -#define RRTRACE(r, m) printf("res %p: %s\n", (r), (m)) -#define FCTXTRACE(m) printf("fctx %p: %s\n", fctx, (m)) -#define FTRACE(m) printf("fetch %p (fctx %p): %s\n", \ - fetch, fetch->private, (m)) -#define QTRACE(m) printf("query %p (res %p fctx %p): %s\n", \ - query, query->fctx->res, query->fctx, (m)) -#define QTRACERESULT(m, r) \ - printf("query %p (res %p fctx %p): %s, result = %s\n", \ - query, query->fctx->res, query->fctx, (m), \ - isc_result_totext((r))) +#define RTRACE(m) isc_log_write(dns_lctx, \ + DNS_LOGCATEGORY_RESOLVER, \ + DNS_LOGMODULE_RESOLVER, \ + 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)) +#define QTRACE(m) isc_log_write(dns_lctx, \ + DNS_LOGCATEGORY_RESOLVER, \ + DNS_LOGMODULE_RESOLVER, \ + ISC_LOG_DEBUG(1), \ + "resquery %p (fctx %p): %s", \ + query, query->fctx, (m)) #else #define RTRACE(m) #define RRTRACE(r, m) #define FCTXTRACE(m) #define FTRACE(m) #define QTRACE(m) -#define QTRACERESULT(m, r) #endif @@ -311,8 +327,6 @@ resquery_senddone(isc_task_t *task, isc_event_t *event) { (void)task; - QTRACERESULT("senddone", sevent->result); - if (sevent->result != ISC_R_SUCCESS) fctx_cancelquery(&query, NULL); @@ -2165,13 +2179,11 @@ resquery_response(isc_task_t *task, isc_event_t *event) { if (keep_trying) { if (result == DNS_R_FORMERR) broken_server = ISC_TRUE; - if (broken_server) { - /* - * XXXRTH We will mark the sender as bad here instead - * of doing the printf(). - */ - printf("broken server\n"); - } + /* + * XXXRTH If we have a broken server at this poing, we will + * decrease its 'goodness', possibly add a 'lame' + * entry, and maybe log a message. + */ /* * Do we need to find the best nameservers for this fetch? */