Add isc_log_createandusechannel() function to simplify usage
The new
isc_log_createandusechannel() function combines following calls:
isc_log_createchannel()
isc_log_usechannel()
calls into a single call that cannot fail and therefore can be used in
places where we know this cannot fail thus simplifying the error
handling.
This commit is contained in:
@@ -1132,17 +1132,17 @@ the following steps need to be taken to initialize it.
|
||||
null, and all other messages to syslog.
|
||||
|
||||
result = isc_log_usechannel(lcfg, "default_stderr",
|
||||
DNS_LOGCATEGORY_SECURITY, NULL);
|
||||
DNS_LOGCATEGORY_SECURITY, ISC_LOGMODULE_DEFAULT);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
oops_it_didnt_work();
|
||||
|
||||
result = isc_log_usechannel(lcfg, "null",
|
||||
DNS_LOGCATEGORY_DATABASE, NULL);
|
||||
DNS_LOGCATEGORY_DATABASE, ISC_LOGMODULE_DEFAULT);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
oops_it_didnt_work();
|
||||
|
||||
result = isc_log_usechannel(lcfg, "default_syslog",
|
||||
ISC_LOGCATEGORY_DEFAULT, NULL);
|
||||
ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_DEFAULT);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
oops_it_didnt_work();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user