A
download log.h
Language: C++
LOC: 20
Project Info
TableHockey3D(tablehockey)
Server: SourceForge
Type: cvs
...ey\CVSROOT\tablehockey\src\
   Application.cpp
   Application.h
   Camera.cpp
   Camera.h
   Cube.cpp
   Cube.h
   Data.cpp
   Data.h
   Disk.cpp
   Disk.h
   FloatingText.cpp
   FloatingText.h
   Floor.cpp
   Floor.h
   Input.cpp
   Input.h
   Light.cpp
   Light.h
   log.cpp
   log.h
   main.cpp
   mmgr.cpp
   mmgr.h
   Model.cpp
   Model.h
   nommgr.h
   Puck.cpp
   Puck.h
   Pyramid.cpp
   Pyramid.h
   scene.cpp
   scene.h
   SmartPtr.h
   Sound.cpp
   Sound.h
   TableHockey.dsp
   TableHockey.dsw
   TestScene.cpp
   TestScene.h
   text.cpp
   text.h
   TextHelp.cpp
   TextHelp.h
   texture.cpp
   texture.h
   TexturedCube.cpp
   TexturedCube.h
   timer.cpp
   timer.h
   View.cpp
   View.h

/*=============================================================================
	log.h: Basic OpenGL Framework logging implementation class

Revision history:
	* Created by Zack Smith
	* Inspired by code written by NeHe (http://nehe.gamedev.net/)
	* Updated October 10, 2000
=============================================================================*/

#if !defined(LOG_H__INCLUDED_)
#define LOG_H__INCLUDED_

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <string>
using namespace std;

/// This class provided nice logging for debugging
class CLog
{
public:
	/**
	 * The constructor
	 * 
	 * @param szPath Name of the file which should be used, use NULL for the default name
	 * @param szMode create file (default) or append new data (use "a")
	 */
	CLog(const char *szPath = NULL, const char* szMode = "w");
	/// destructor
	~CLog();
	/// open the file if it's not opened
	void Open();
	/// close the file
	void Close();
	/// write logging data, use like "printf"
	void Log(char *szText, ...);

private:
	FILE *m_fLog;
	string m_szPath;

};

#endif // !defined(LOG_H__INCLUDED_)

/*-----------------------------------------------------------------------------
	The End.
-----------------------------------------------------------------------------*/

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us