Ogre及C++程序日志文件

static void My_Log(float rx, float ry, float rz){

	char* filename="my_test1.log";

	FILE *fo;
	fo = fopen(filename,"a");
	if(fo == 0){
		return;
	}

	fprintf(fo,"BVH:   x:%f; y:%f; z:%f \r\n",rx,ry,rz);
	fclose(fo);
};

如果直接调用Ogre中的日志文件,方法如下:

Log* mLog = LogManager::getSingleton().createLog( "data.log" );
std::stringstream ss;
ss<<"cursorPos1 X: "<<cursorPos1.x<<", Y: "<<cursorPos1.y<<endl;
ss<<"cursorPos2 X: "<<cursorPos2.x<<", Y: "<<cursorPos2.y<<endl;
mLog->logMessage(ss.str());


你可能感兴趣的:(Ogre及C++程序日志文件)