log.h

来自「提供windows和unix下各种级别日志,包括 xml」· C头文件 代码 · 共 43 行

H
43
字号
// TTrace.h: interface for the TTrace class.
//
//////////////////////////////////////////////////////////////////////

#ifndef __LOG_H__
#define __LOG_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <iostream.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <time.h>
#include <dirent.h>

class CLogFile
{
private:
	char  m_szFilePath[256];
	int   m_nFileSize;

    FILE*	m_pLogFile;
	bool bOpen;

// Construction
public:
	CLogFile();
	~CLogFile();

    void SetPath(const char* szPath,char* fileName);
	void WriteLog(const char *pBuffer);

	bool IsWriteLog();
	void ShowInfo(char* buffer);
	void StartWriteLog();
	void StopWriteLog();
	void WriteInfoLog(bool bShow,const char* fmt, ... );
	void WriteErrorLog(bool bShow,const char* fmt, ... );
};
#endif 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?