示例#1
0
void
test_001(Fixture *fixture, G_GNUC_UNUSED gconstpointer data)
{
	GType type = g_type_from_name("Log4gSimpleLayout");
	g_assert(type);
	Log4gLayout *layout = g_object_new(type, NULL);
	g_assert(layout);
	log4g_layout_activate_options(layout);
	g_message("%s", log4g_layout_format(layout, fixture->event));
	g_object_unref(layout);
}
示例#2
0
void
test_001(Fixture *fixture, gconstpointer data)
{
	GType type = g_type_from_name("Log4gXMLLayout");
	g_assert(type);
	Log4gLayout *layout = g_object_new(type,
			"properties", TRUE,
			"location-info", TRUE,
			NULL);
	g_assert(layout);
	log4g_layout_activate_options(layout);
	g_message("%s", log4g_layout_format(layout, fixture->event));
	g_object_unref(layout);
}
示例#3
0
void
test_001(Fixture *fixture, gconstpointer data)
{
	GType type = g_type_from_name("Log4gPatternLayout");
	g_assert(type);
	Log4gLayout *layout = g_object_new(type,
			"conversion-pattern",
				"[%d{%c}] [%t] [%.7c{2}] %M(%F:%L) "
				"[%.5m] [%20p] [%r] [%X{foo}] [%x] %m%n",
			NULL);
	g_assert(layout);
	log4g_layout_activate_options(layout);
	g_message("%s", log4g_layout_format(layout, fixture->event));
	g_object_unref(layout);
}