当前位置: 首页>>代码示例>>C++>>正文


C++ ISC_LOG_DEBUG函数代码示例

本文整理汇总了C++中ISC_LOG_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ ISC_LOG_DEBUG函数的具体用法?C++ ISC_LOG_DEBUG怎么用?C++ ISC_LOG_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ISC_LOG_DEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dump_symboltable

static void
dump_symboltable(void) {
	int i;
	isc_result_t result;
	const char *fname;
	const void *addr;

	if (isc__backtrace_nsymbols == 0)
		return;

	if (!isc_log_wouldlog(ns_g_lctx, ISC_LOG_DEBUG(99)))
		return;

	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
		      ISC_LOG_DEBUG(99), "Symbol table:");

	for (i = 0, result = ISC_R_SUCCESS; result == ISC_R_SUCCESS; i++) {
		addr = NULL;
		fname = NULL;
		result = isc_backtrace_getsymbolfromindex(i, &addr, &fname);
		if (result == ISC_R_SUCCESS) {
			isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
				      NS_LOGMODULE_MAIN, ISC_LOG_DEBUG(99),
				      "[%d] %p %s", i, addr, fname);
		}
	}
}
开发者ID:fatman2021,项目名称:netbsd-src,代码行数:27,代码来源:main.c

示例2: try_dscp_v6

static void
try_dscp_v6(void) {
#ifdef ISC_PLATFORM_HAVEIPV6
#ifdef WANT_IPV6
#ifdef IPV6_TCLASS
	char strbuf[ISC_STRERRORSIZE];
	struct addrinfo hints, *res0;
	int s, dscp = 0, n;
#if defined(IPV6_RECVTCLASS)
	int on = 1;
#endif /* IPV6_RECVTCLASS */

	memset(&hints, 0, sizeof(hints));
	hints.ai_family = AF_INET6;
	hints.ai_socktype = SOCK_DGRAM;
	hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
	hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
#else
	hints.ai_flags = AI_PASSIVE;
#endif

	n = getaddrinfo("::1", NULL, &hints, &res0);
	if (n != 0 || res0 == NULL) {
		isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
			      ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(10),
			      "getaddrinfo(::1): %s", gai_strerror(n));
		return;
	}

	s = socket(res0->ai_family, res0->ai_socktype, res0->ai_protocol);
	if (s == -1) {
		isc__strerror(errno, strbuf, sizeof(strbuf));
		isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
			      ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(10),
			      "socket: %s", strbuf);
		freeaddrinfo(res0);
		return;
	}
	if (setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &dscp, sizeof(dscp)) == 0)
		dscp_result |= ISC_NET_DSCPSETV6;

#ifdef IPV6_RECVTCLASS
	on = 1;
	if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVTCLASS, &on, sizeof(on)) == 0)
		dscp_result |= ISC_NET_DSCPRECVV6;
#endif /* IPV6_RECVTCLASS */

#ifdef ISC_NET_BSD44MSGHDR
	if (cmsgsend(s, IPPROTO_IPV6, IPV6_TCLASS, res0))
		dscp_result |= ISC_NET_DSCPPKTV6;
#endif /* ISC_NET_BSD44MSGHDR */

	freeaddrinfo(res0);
	close(s);

#endif /* IPV6_TCLASS */
#endif /* WANT_IPV6 */
#endif /* ISC_PLATFORM_HAVEIPV6 */
}
开发者ID:fatman2021,项目名称:netbsd-src,代码行数:60,代码来源:net.c

示例3: dns_dlzdestroy

void
dns_dlzdestroy(dns_dlzdb_t **dbp) {
	isc_mem_t *mctx;
	dns_dlzdestroy_t destroy;

	/* Write debugging message to log */
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
		      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
		      "Unloading DLZ driver.");

	/*
	 * Perform checks to make sure data is as we expect it to be.
	 */
	REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));

#ifdef BIND9
	if ((*dbp)->ssutable != NULL) {
		dns_ssutable_detach(&(*dbp)->ssutable);
	}
#endif

	/* call the drivers destroy method */
	if ((*dbp) != NULL) {
		mctx = (*dbp)->mctx;
		destroy = (*dbp)->implementation->methods->destroy;
		(*destroy)((*dbp)->implementation->driverarg,(*dbp)->dbdata);
		/* return memory */
		isc_mem_put(mctx, (*dbp), sizeof(dns_dlzdb_t));
		isc_mem_detach(&mctx);
	}

	*dbp = NULL;
}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:33,代码来源:dlz.c

示例4: dlz_mysql_init

/*%
 * Wrapper around dns_sdlzregister().
 */
isc_result_t
dlz_mysql_init(void) {
	isc_result_t result;

	/*
	 * Write debugging message to log
	 */
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
		      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
		      "Registering DLZ mysql driver.");

	/* Driver is always threadsafe.  Because of the way MySQL handles
         * threads the MySQL driver can only be used when bind is run single
         * threaded.  Using MySQL with Bind running multi-threaded is not
         * allowed.  When using the MySQL driver "-n1" should always be
         * passed to Bind to guarantee single threaded operation.
	 */
	result = dns_sdlzregister("mysql", &dlz_mysql_methods, NULL,
				  DNS_SDLZFLAG_RELATIVEOWNER |
				  DNS_SDLZFLAG_RELATIVERDATA |
				  DNS_SDLZFLAG_THREADSAFE,
				  ns_g_mctx, &dlz_mysql);
	/* if we can't register the driver, there are big problems. */
	if (result != ISC_R_SUCCESS) {
		UNEXPECTED_ERROR(__FILE__, __LINE__,
				 "dns_sdlzregister() failed: %s",
				 isc_result_totext(result));
		result = ISC_R_UNEXPECTED;
	}


	return result;
}
开发者ID:gosudream,项目名称:netbsd-src,代码行数:36,代码来源:dlz_mysql_driver.c

示例5: dns_dlzdestroy

void
dns_dlzdestroy(dns_dlzdb_t **dbp) {
	dns_dlzdestroy_t destroy;
	dns_dlzdb_t *db;

	/* Write debugging message to log */
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
		      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
		      "Unloading DLZ driver.");

	/*
	 * Perform checks to make sure data is as we expect it to be.
	 */
	REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));

	db = *dbp;
	*dbp = NULL;

	if (db->ssutable != NULL)
		dns_ssutable_detach(&db->ssutable);

	/* call the drivers destroy method */
	if (db->dlzname != NULL)
		isc_mem_free(db->mctx, db->dlzname);
	destroy = db->implementation->methods->destroy;
	(*destroy)(db->implementation->driverarg, db->dbdata);
	/* return memory and detach */
	isc_mem_putanddetach(&db->mctx, db, sizeof(dns_dlzdb_t));
}
开发者ID:crossbuild,项目名称:bind,代码行数:29,代码来源:dlz.c

示例6: dlz_postgres_init

/*%
 * Wrapper around dns_sdlzregister().
 */
isc_result_t
dlz_postgres_init(void) {
	isc_result_t result;

	/*
	 * Write debugging message to log
	 */
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
		      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
		      "Registering DLZ postgres driver.");

	/*
	 * Driver is always threadsafe.  When multithreaded all
	 * functions use multithreaded code.  When not multithreaded,
	 * all functions can only be entered once, but only 1 thread
	 * of operation is available in Bind.  So everything is still
	 * threadsafe.
	 */
	result = dns_sdlzregister("postgres", &dlz_postgres_methods, NULL,
				  DNS_SDLZFLAG_RELATIVEOWNER |
				  DNS_SDLZFLAG_RELATIVERDATA |
				  DNS_SDLZFLAG_THREADSAFE,
				  ns_g_mctx, &dlz_postgres);
	/* if we can't register the driver, there are big problems. */
	if (result != ISC_R_SUCCESS) {
		UNEXPECTED_ERROR(__FILE__, __LINE__,
				 "dns_sdlzregister() failed: %s",
				 isc_result_totext(result));
		result = ISC_R_UNEXPECTED;
	}


	return result;
}
开发者ID:w796933,项目名称:bind99damp,代码行数:37,代码来源:dlz_postgres_driver.c

示例7: dlz_bdbhpt_init

/*%
 * Wrapper around dns_sdlzregister().
 */
isc_result_t
dlz_bdbhpt_init(void) {
	isc_result_t result;

	/*
	 * Write debugging message to log
	 */
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
		      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
		      "Registering DLZ bdbhpt driver.");

	result = dns_sdlzregister("bdbhpt", &dlz_bdbhpt_methods, NULL,
				  DNS_SDLZFLAG_RELATIVEOWNER |
				  DNS_SDLZFLAG_RELATIVERDATA |
				  DNS_SDLZFLAG_THREADSAFE,
				  ns_g_mctx, &dlz_bdbhpt);
	if (result != ISC_R_SUCCESS) {
		UNEXPECTED_ERROR(__FILE__, __LINE__,
				 "dns_sdlzregister() failed: %s",
				 isc_result_totext(result));
		result = ISC_R_UNEXPECTED;
	}


	return result;
}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:29,代码来源:dlz_bdbhpt_driver.c

示例8: ssu_e_log

static void ssu_e_log (int level, const char *fmt, ...)
{
    va_list ap;

    va_start (ap, fmt);
    isc_log_vwrite (dns_lctx, DNS_LOGCATEGORY_SECURITY, DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG (level), fmt, ap);
    va_end (ap);
}
开发者ID:274914765,项目名称:C,代码行数:8,代码来源:ssu_external.c

示例9: tkey_log

     static void tkey_log (const char *fmt, ...)
{
    va_list ap;

    va_start (ap, fmt);
    isc_log_vwrite (dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, ISC_LOG_DEBUG (4), fmt, ap);
    va_end (ap);
}
开发者ID:274914765,项目名称:C,代码行数:8,代码来源:tkey.c

示例10: supervisor_destroy

int supervisor_destroy(supervisor_t *sv) {
    zmq_close(sv->zmq_sock_rpc);
    zmq_ctx_destroy(sv->zmq_ctx);
    free(sv);
    supervisor_log(ISC_LOG_DEBUG(1), "supervisor destroyed");

    return 0;
}
开发者ID:mduszyk,项目名称:bind,代码行数:8,代码来源:supervisor.c

示例11: freezezones

static isc_result_t
freezezones(dns_zone_t *zone, void *uap) {
	isc_boolean_t freeze = *(isc_boolean_t *)uap;
	isc_boolean_t frozen;
	isc_result_t result = ISC_R_SUCCESS;
	char classstr[DNS_RDATACLASS_FORMATSIZE];
	char zonename[DNS_NAME_FORMATSIZE];
	dns_view_t *view;
	char *journal;
	const char *vname;
	const char *sep;
	int level;

	if (dns_zone_gettype(zone) != dns_zone_master)
		return (ISC_R_SUCCESS);

	frozen = dns_zone_getupdatedisabled(zone);
	if (freeze) {
		if (frozen)
			result = DNS_R_FROZEN;
		if (result == ISC_R_SUCCESS)
			result = dns_zone_flush(zone);
		if (result == ISC_R_SUCCESS) {
			journal = dns_zone_getjournal(zone);
			if (journal != NULL)
				(void)isc_file_remove(journal);
		}
	} else {
		if (frozen) {
			result = dns_zone_load(zone);
			if (result == DNS_R_CONTINUE ||
			    result == DNS_R_UPTODATE)
				result = ISC_R_SUCCESS;
		}
	}
	if (result == ISC_R_SUCCESS)
		dns_zone_setupdatedisabled(zone, freeze);
	view = dns_zone_getview(zone);
	if (strcmp(view->name, "_bind") == 0 ||
	    strcmp(view->name, "_default") == 0)
	{
		vname = "";
		sep = "";
	} else {
		vname = view->name;
		sep = " ";
	}
	dns_rdataclass_format(dns_zone_getclass(zone), classstr,
			      sizeof(classstr));
	dns_name_format(dns_zone_getorigin(zone), zonename, sizeof(zonename));
	level = (result != ISC_R_SUCCESS) ? ISC_LOG_ERROR : ISC_LOG_DEBUG(1);
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE,
		      level, "%s zone '%s/%s'%s%s: %s",
		      freeze ? "freezing" : "thawing",
		      zonename, classstr, sep, vname,
		      isc_result_totext(result));
	return (result);
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:58,代码来源:zt.c

示例12: dlopen_log

/*
 * Log a message at the given level.
 */
static void dlopen_log(int level, const char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE,
		       DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(level),
		       fmt, ap);
	va_end(ap);
}
开发者ID:crossbuild,项目名称:bind,代码行数:12,代码来源:dlz_dlopen_driver.c

示例13: gss_log

void
gss_log(int level, const char *fmt, ...) {
	va_list ap;

	va_start(ap, fmt);
	isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL,
		       DNS_LOGMODULE_TKEY, ISC_LOG_DEBUG(level), fmt, ap);
	va_end(ap);
}
开发者ID:coapp-packages,项目名称:bind,代码行数:9,代码来源:gssapictx.c

示例14: setup_logging

void setup_logging (int verbose, isc_mem_t * mctx, isc_log_t ** logp)
{
    isc_result_t result;

    isc_logdestination_t destination;

    isc_logconfig_t *logconfig = NULL;

    isc_log_t *log = NULL;

    int level;

    if (verbose < 0)
        verbose = 0;
    switch (verbose)
    {
        case 0:
            /*
             * We want to see warnings about things like out-of-zone
             * data in the master file even when not verbose.
             */
            level = ISC_LOG_WARNING;
            break;
        case 1:
            level = ISC_LOG_INFO;
            break;
        default:
            level = ISC_LOG_DEBUG (verbose - 2 + 1);
            break;
    }

    RUNTIME_CHECK (isc_log_create (mctx, &log, &logconfig) == ISC_R_SUCCESS);
    isc_log_setcontext (log);
    dns_log_init (log);
    dns_log_setcontext (log);

    RUNTIME_CHECK (isc_log_settag (logconfig, program) == ISC_R_SUCCESS);

    /*
     * Set up a channel similar to default_stderr except:
     *  - the logging level is passed in
     *  - the program name and logging level are printed
     *  - no time stamp is printed
     */
    destination.file.stream = stderr;
    destination.file.name = NULL;
    destination.file.versions = ISC_LOG_ROLLNEVER;
    destination.file.maximum_size = 0;
    result = isc_log_createchannel (logconfig, "stderr",
                                    ISC_LOG_TOFILEDESC, level, &destination, ISC_LOG_PRINTTAG | ISC_LOG_PRINTLEVEL);
    check_result (result, "isc_log_createchannel()");

    RUNTIME_CHECK (isc_log_usechannel (logconfig, "stderr", NULL, NULL) == ISC_R_SUCCESS);

    *logp = log;
}
开发者ID:274914765,项目名称:C,代码行数:56,代码来源:dnssectool.c

示例15: dlz_ldap_clear

/*%
 * Wrapper around dns_sdlzunregister().
 */
void dlz_ldap_clear (void)
{
    /*
     * Write debugging message to log
     */
    isc_log_write (dns_lctx, DNS_LOGCATEGORY_DATABASE,
                   DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG (2), "Unregistering DLZ ldap driver.");

    if (dlz_ldap != NULL)
        dns_sdlzunregister (&dlz_ldap);
}
开发者ID:274914765,项目名称:C,代码行数:14,代码来源:dlz_ldap_driver.c


注:本文中的ISC_LOG_DEBUG函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。