Remove logging context (isc_log_t) from the public namespace
Now that the logging uses single global context, remove the isc_log_t from the public namespace.
This commit is contained in:
@@ -54,9 +54,9 @@
|
||||
#define ZIPF 0
|
||||
|
||||
#if VERBOSE
|
||||
#define TRACE(fmt, ...) \
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
|
||||
ISC_LOG_DEBUG(7), "%s:%d:%s():t%d: " fmt, __FILE__, \
|
||||
#define TRACE(fmt, ...) \
|
||||
isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
|
||||
ISC_LOG_DEBUG(7), "%s:%d:%s():t%d: " fmt, __FILE__, \
|
||||
__LINE__, __func__, isc_tid(), ##__VA_ARGS__)
|
||||
#else
|
||||
#define TRACE(...)
|
||||
@@ -157,11 +157,10 @@ init_logging(void) {
|
||||
isc_result_t result;
|
||||
isc_logdestination_t destination;
|
||||
isc_logconfig_t *logconfig = NULL;
|
||||
isc_log_t *lctx = NULL;
|
||||
|
||||
dns_log_init(lctx);
|
||||
dns_log_init();
|
||||
|
||||
logconfig = isc_logconfig_get(lctx);
|
||||
logconfig = isc_logconfig_get();
|
||||
destination.file.stream = stderr;
|
||||
destination.file.name = NULL;
|
||||
destination.file.versions = ISC_LOG_ROLLNEVER;
|
||||
@@ -171,7 +170,7 @@ init_logging(void) {
|
||||
ISC_LOG_PRINTPREFIX | ISC_LOG_PRINTTIME |
|
||||
ISC_LOG_ISO8601);
|
||||
#if VERBOSE
|
||||
isc_log_setdebuglevel(lctx, 7);
|
||||
isc_log_setdebuglevel(7);
|
||||
#endif
|
||||
|
||||
result = isc_log_usechannel(logconfig, "stderr",
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
#define TRANSACTION_COUNT 1234
|
||||
|
||||
#if VERBOSE
|
||||
#define TRACE(fmt, ...) \
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
|
||||
ISC_LOG_DEBUG(7), "%s:%d:%s(): " fmt, __FILE__, \
|
||||
#define TRACE(fmt, ...) \
|
||||
isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
|
||||
ISC_LOG_DEBUG(7), "%s:%d:%s(): " fmt, __FILE__, \
|
||||
__LINE__, __func__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define TRACE(...)
|
||||
@@ -72,9 +72,9 @@ setup_logging(void) {
|
||||
isc_logdestination_t destination;
|
||||
isc_logconfig_t *logconfig = NULL;
|
||||
|
||||
dns_log_init(lctx);
|
||||
dns_log_init();
|
||||
|
||||
logconfig = isc_logconfig_get(lctx);
|
||||
logconfig = isc_logconfig_get();
|
||||
destination.file.stream = stderr;
|
||||
destination.file.name = NULL;
|
||||
destination.file.versions = ISC_LOG_ROLLNEVER;
|
||||
@@ -85,7 +85,7 @@ setup_logging(void) {
|
||||
ISC_LOG_ISO8601);
|
||||
|
||||
#if VERBOSE
|
||||
isc_log_setdebuglevel(lctx, 7);
|
||||
isc_log_setdebuglevel(7);
|
||||
#endif
|
||||
|
||||
result = isc_log_usechannel(logconfig, "stderr",
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <isc/uv.h>
|
||||
|
||||
extern isc_mem_t *mctx;
|
||||
extern isc_log_t *lctx;
|
||||
extern isc_loop_t *mainloop;
|
||||
extern isc_loopmgr_t *loopmgr;
|
||||
extern isc_nm_t *netmgr;
|
||||
|
||||
@@ -52,9 +52,9 @@ ISC_SETUP_TEST_IMPL(group) {
|
||||
isc_logdestination_t destination;
|
||||
isc_logconfig_t *logconfig = NULL;
|
||||
|
||||
isc_log_registercategories(lctx, categories);
|
||||
isc_log_registercategories(categories);
|
||||
|
||||
logconfig = isc_logconfig_get(lctx);
|
||||
logconfig = isc_logconfig_get();
|
||||
destination.file.stream = stderr;
|
||||
destination.file.name = NULL;
|
||||
destination.file.versions = ISC_LOG_ROLLNEVER;
|
||||
@@ -167,7 +167,7 @@ ISC_RUN_TEST_IMPL(duration) {
|
||||
isc_buffer_add(&buf1, strlen(conf) - 1);
|
||||
|
||||
/* Parse with default line numbering */
|
||||
result = cfg_parser_create(mctx, lctx, &p1);
|
||||
result = cfg_parser_create(mctx, &p1);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = cfg_parse_buffer(p1, &buf1, "text1", 0,
|
||||
|
||||
@@ -53,9 +53,9 @@ ISC_SETUP_TEST_IMPL(group) {
|
||||
isc_logdestination_t destination;
|
||||
isc_logconfig_t *logconfig = NULL;
|
||||
|
||||
isc_log_registercategories(lctx, categories);
|
||||
isc_log_registercategories(categories);
|
||||
|
||||
logconfig = isc_logconfig_get(lctx);
|
||||
logconfig = isc_logconfig_get();
|
||||
destination.file.stream = stderr;
|
||||
destination.file.name = NULL;
|
||||
destination.file.versions = ISC_LOG_ROLLNEVER;
|
||||
@@ -95,7 +95,7 @@ ISC_RUN_TEST_IMPL(addzoneconf) {
|
||||
char buf[1024];
|
||||
|
||||
/* Parse with default line numbering */
|
||||
result = cfg_parser_create(mctx, lctx, &p);
|
||||
result = cfg_parser_create(mctx, &p);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(tests); i++) {
|
||||
@@ -143,7 +143,7 @@ ISC_RUN_TEST_IMPL(parse_buffer) {
|
||||
isc_buffer_add(&buf1, sizeof(text) - 1);
|
||||
|
||||
/* Parse with default line numbering */
|
||||
result = cfg_parser_create(mctx, lctx, &p1);
|
||||
result = cfg_parser_create(mctx, &p1);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = cfg_parse_buffer(p1, &buf1, "text1", 0, &cfg_type_namedconf, 0,
|
||||
@@ -155,7 +155,7 @@ ISC_RUN_TEST_IMPL(parse_buffer) {
|
||||
isc_buffer_add(&buf2, sizeof(text) - 1);
|
||||
|
||||
/* Parse with changed line number */
|
||||
result = cfg_parser_create(mctx, lctx, &p2);
|
||||
result = cfg_parser_create(mctx, &p2);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = cfg_parse_buffer(p2, &buf2, "text2", 100, &cfg_type_namedconf,
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <tests/isc.h>
|
||||
|
||||
isc_mem_t *mctx = NULL;
|
||||
isc_log_t *lctx = NULL;
|
||||
isc_loop_t *mainloop = NULL;
|
||||
isc_loopmgr_t *loopmgr = NULL;
|
||||
isc_nm_t *netmgr = NULL;
|
||||
|
||||
Reference in New Issue
Block a user