]> git.ipfire.org Git - thirdparty/bind9.git/commit
Replace isc_log_create/destroy with isc_logconfig_get()
authorOndřej Surý <ondrej@isc.org>
Tue, 13 Aug 2024 13:52:51 +0000 (15:52 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 20 Aug 2024 12:50:39 +0000 (12:50 +0000)
commitb2dda8625444f7f409aed691574f819d0edd717d
tree8d9e5cce58477ee7ab2a2a1d7386bff5d0053f82
parenta8a689531f13abcbf100a57f6c65d4c5a0cb07f7
Replace isc_log_create/destroy with isc_logconfig_get()

Add isc_logconfig_get() function to get the current logconfig and use
the getter to replace most of the little dancing around setting up
logging in the tools. Thus:

    isc_log_create(mctx, &lctx, &logconfig);
    isc_log_setcontext(lctx);
    dns_log_setcontext(lctx);
    ...
    ...use lcfg...
    ...
    isc_log_destroy();

is now only:

    logconfig = isc_logconfig_get(lctx);
    ...use lcfg...

For thread-safety, isc_logconfig_get() should be surrounded by RCU read
lock, but since we never use isc_logconfig_get() in threaded context,
the only place where it is actually used (but not really needed) is
named_log_init().
29 files changed:
bin/check/check-tool.c
bin/check/named-checkconf.c
bin/check/named-checkzone.c
bin/delv/delv.c
bin/dig/dighost.c
bin/dnssec/dnssectool.c
bin/named/include/named/log.h
bin/named/log.c
bin/named/server.c
bin/nsupdate/nsupdate.c
bin/rndc/rndc.c
bin/tests/system/makejournal.c
bin/tests/system/pipelined/pipequeries.c
bin/tests/system/rsabigexponent/bigkey.c
bin/tools/mdig.c
bin/tools/named-journalprint.c
doc/dev/dev.md
doc/misc/cfg_test.c
lib/dns/include/dns/log.h
lib/dns/log.c
lib/isc/include/isc/log.h
lib/isc/log.c
lib/isccfg/log.c
lib/ns/include/ns/log.h
lib/ns/log.c
tests/bench/qpmulti.c
tests/dns/qpmulti_test.c
tests/isccfg/duration_test.c
tests/isccfg/parser_test.c