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

Use proper logging in test.

This commit is contained in:
James Brister 1999-12-17 18:28:03 +00:00
parent 7027fd24a2
commit c8ca2bc590

View File

@ -80,6 +80,7 @@ int main (int argc, char **argv) {
FILE *outfp; FILE *outfp;
isc_mem_t *mem = NULL; isc_mem_t *mem = NULL;
dns_c_cbks_t callbacks; dns_c_cbks_t callbacks;
isc_log_t *log = NULL;
#if 1 #if 1
callbacks.zonecbk = NULL; callbacks.zonecbk = NULL;
@ -107,6 +108,14 @@ int main (int argc, char **argv) {
RUNTIME_CHECK(isc_mem_create(0, 0, &mem) == ISC_R_SUCCESS); RUNTIME_CHECK(isc_mem_create(0, 0, &mem) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_log_create(mem, &log) == ISC_R_SUCCESS);
RUNTIME_CHECK(dns_log_init(log) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_log_usechannel(log, "default_stderr", NULL, NULL)
== ISC_R_SUCCESS);
dns_lctx = log;
if (dns_c_parse_namedconf(conffile, mem, &configctx, &callbacks) != if (dns_c_parse_namedconf(conffile, mem, &configctx, &callbacks) !=
ISC_R_SUCCESS) { ISC_R_SUCCESS) {
fprintf(stderr, "parse_configuration failed.\n"); fprintf(stderr, "parse_configuration failed.\n");
@ -147,6 +156,10 @@ int main (int argc, char **argv) {
} }
dns_c_ctx_delete(&configctx); dns_c_ctx_delete(&configctx);
dns_lctx = NULL;
isc_log_destroy(&log);
isc_mem_destroy(&mem); isc_mem_destroy(&mem);
return (0); return (0);