Beispiel #1
0
static void
log_test(void)
{
	int rc = 0;

	rc = spdk_set_log_facility("test");
	CU_ASSERT(rc == -1);
	rc = spdk_set_log_facility("local7");
	CU_ASSERT(rc == 0);
	rc = spdk_set_log_priority("test");
	CU_ASSERT(rc == -1);
	rc = spdk_set_log_priority("debug");
	CU_ASSERT(rc == 0);

#ifdef DEBUG
	CU_ASSERT(spdk_log_get_trace_flag("debug") == false);

	spdk_log_set_trace_flag("debug");
	CU_ASSERT(spdk_log_get_trace_flag("debug") == true);

	spdk_log_clear_trace_flag("debug");
	CU_ASSERT(spdk_log_get_trace_flag("debug") == false);
#endif

	spdk_open_log();
	spdk_log_set_trace_flag("debug");
	SPDK_WARNLOG("log warning unit test\n");
	SPDK_TRACELOG(SPDK_TRACE_DEBUG, "log trace test\n");
	SPDK_TRACEDUMP(SPDK_TRACE_DEBUG, "log trace dump test:", "trace dump", 10);
	spdk_trace_dump("spdk dump test:", "spdk dump", 9);

	spdk_close_log();
}
Beispiel #2
0
Datei: app.c Projekt: lkpdn/spdk
void
spdk_app_fini(void)
{
	spdk_subsystem_fini();
	spdk_trace_cleanup();
	spdk_app_remove_pidfile();
	spdk_conf_free(g_spdk_app.config);
	spdk_close_log();
}