Esempio n. 1
0
void printGameState(struct game_t* game)
{
    ZF_LOGW("state: %d -> %d, level %d -> %d, time %d -> %d.",
            game->prevState.state, game->curState.state,
            game->prevState.level, game->curState.level,
            game->prevState.timer, game->curState.timer);
}
Esempio n. 2
0
static void file_output_open(const char *const log_path)
{
	g_log_file = fopen(log_path, "a");
	if (!g_log_file)
	{
		ZF_LOGW("Failed to open log file %s", log_path);
		return;
	}
	atexit(file_output_close);
	zf_log_set_output_v(ZF_LOG_PUT_STD, 0, file_output_callback);
}
Esempio n. 3
0
int main(int argc, char *argv[])
{
	zf_log_set_tag_prefix("hello");

	ZF_LOGI("You will see the number of arguments: %i", argc);
	ZF_LOGD("You will NOT see the first argument: %s", *argv);

	zf_log_set_output_level(ZF_LOG_WARN);
	ZF_LOGW("You will see this WARNING message");
	ZF_LOGI("You will NOT see this INFO message");

	const char data[] =
			"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
			"Aliquam pharetra orci id velit porttitor tempus.";
	ZF_LOGW_MEM(data, sizeof(data), "Lorem ipsum at %p:", data);

	return 0;
}