Lines Matching defs:lcfg
46 #define VALID_CONFIG(lcfg) ISC_MAGIC_VALID(lcfg, LCFG_MAGIC)
210 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
214 sync_channellist(isc_logconfig_t *lcfg);
217 sync_highest_level(isc_log_t *lctx, isc_logconfig_t *lcfg);
251 isc_logconfig_t *lcfg = NULL;
274 isc_logconfig_create(lctx, &lcfg);
275 sync_channellist(lcfg);
277 lctx->logconfig = lcfg;
279 atomic_init(&lctx->highest_level, lcfg->highest_level);
280 atomic_init(&lctx->dynamic, lcfg->dynamic);
283 SET_IF_NOT_NULL(lcfgp, lcfg);
288 isc_logconfig_t *lcfg;
295 lcfg = isc_mem_get(lctx->mctx, sizeof(*lcfg));
297 *lcfg = (isc_logconfig_t){
309 isc_log_createchannel(lcfg, "default_syslog", ISC_LOG_TOSYSLOG, level,
317 isc_log_createchannel(lcfg, "default_stderr", ISC_LOG_TOFILEDESC, level,
325 default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
332 isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILEDESC,
335 isc_log_createchannel(lcfg, "null", ISC_LOG_TONULL, ISC_LOG_DYNAMIC,
338 *lcfgp = lcfg;
342 isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg) {
346 REQUIRE(VALID_CONFIG(lcfg));
347 REQUIRE(lcfg->lctx == lctx);
350 * Ensure that lcfg->channellist_count == lctx->category_count.
354 sync_channellist(lcfg);
356 old_cfg = rcu_xchg_pointer(&lctx->logconfig, lcfg);
357 sync_highest_level(lctx, lcfg);
366 isc_logconfig_t *lcfg;
381 lcfg = rcu_xchg_pointer(&lctx->logconfig, NULL);
384 if (lcfg != NULL) {
385 isc_logconfig_destroy(&lcfg);
410 isc_logconfig_t *lcfg;
418 lcfg = *lcfgp;
425 REQUIRE(lcfg->lctx != NULL);
428 REQUIRE(rcu_dereference(lcfg->lctx->logconfig) != lcfg);
431 mctx = lcfg->lctx->mctx;
433 while ((channel = ISC_LIST_HEAD(lcfg->channels)) != NULL) {
434 ISC_LIST_UNLINK(lcfg->channels, channel, link);
455 for (i = 0; i < lcfg->channellist_count; i++) {
457 while ((item = ISC_LIST_HEAD(lcfg->channellists[i])) != NULL) {
458 ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
463 if (lcfg->channellist_count > 0) {
464 isc_mem_cput(mctx, lcfg->channellists, lcfg->channellist_count,
468 lcfg->dynamic = false;
469 if (lcfg->tag != NULL) {
470 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
472 lcfg->tag = NULL;
473 lcfg->highest_level = 0;
474 lcfg->duplicate_interval = 0;
475 lcfg->magic = 0;
477 isc_mem_put(mctx, lcfg, sizeof(*lcfg));
623 isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
633 REQUIRE(VALID_CONFIG(lcfg));
643 mctx = lcfg->lctx->mctx;
690 ISC_LIST_PREPEND(lcfg->channels, channel, link);
702 isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
708 REQUIRE(VALID_CONFIG(lcfg));
711 lctx = lcfg->lctx;
716 for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL;
729 assignchannel(lcfg, category->id, module, channel);
736 assignchannel(lcfg, i, module, channel);
741 * Update the highest logging level, if the current lcfg is in use.
744 if (rcu_dereference(lcfg->lctx->logconfig) == lcfg) {
745 sync_highest_level(lctx, lcfg);
815 isc_logconfig_t *lcfg = rcu_dereference(lctx->logconfig);
816 if (lcfg != NULL) {
819 ISC_LIST_HEAD(lcfg->channels);
845 isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval) {
846 REQUIRE(VALID_CONFIG(lcfg));
848 lcfg->duplicate_interval = interval;
852 isc_log_getduplicateinterval(isc_logconfig_t *lcfg) {
853 REQUIRE(VALID_CONTEXT(lcfg));
855 return lcfg->duplicate_interval;
859 isc_log_settag(isc_logconfig_t *lcfg, const char *tag) {
860 REQUIRE(VALID_CONFIG(lcfg));
863 if (lcfg->tag != NULL) {
864 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
866 lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
868 if (lcfg->tag != NULL) {
869 isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
871 lcfg->tag = NULL;
876 isc_log_gettag(isc_logconfig_t *lcfg) {
877 REQUIRE(VALID_CONFIG(lcfg));
879 return lcfg->tag;
893 isc_logconfig_t *lcfg = rcu_dereference(lctx->logconfig);
894 if (lcfg != NULL) {
896 for (isc_logchannel_t *channel = ISC_LIST_HEAD(lcfg->channels);
916 assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
921 REQUIRE(VALID_CONFIG(lcfg));
923 lctx = lcfg->lctx;
930 * Ensure lcfg->channellist_count == lctx->category_count.
932 sync_channellist(lcfg);
938 ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id], new_item,
947 if (lcfg->highest_level < channel->level) {
948 lcfg->highest_level = channel->level;
951 lcfg->dynamic = true;
961 sync_channellist(isc_logconfig_t *lcfg) {
962 REQUIRE(VALID_CONFIG(lcfg));
964 isc_log_t *lctx = lcfg->lctx;
968 if (lctx->category_count == lcfg->channellist_count) {
972 lcfg->channellists = isc_mem_creget(
973 lctx->mctx, lcfg->channellists, lcfg->channellist_count,
976 lcfg->channellist_count = lctx->category_count;
980 sync_highest_level(isc_log_t *lctx, isc_logconfig_t *lcfg) {
981 atomic_store(&lctx->highest_level, lcfg->highest_level);
982 atomic_store(&lctx->dynamic, lcfg->dynamic);
1519 isc_logconfig_t *lcfg = rcu_dereference(lctx->logconfig);
1520 if (lcfg == NULL) {
1524 category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]);
1540 category_channels != ISC_LIST_HEAD(lcfg->channellists[0]))
1547 ISC_LIST_HEAD(lcfg->channellists[0]);
1637 lcfg->duplicate_interval, 0);
1733 lcfg->tag != NULL);
1735 lcfg->tag != NULL);
1808 printtime ? " " : "", printtag ? lcfg->tag : "",
1855 printtime ? " " : "", printtag ? lcfg->tag : "",