📄 vtrace.h
字号:
#ifndef _MYTRACE_H_
#define _MYTRACE_H_
//s#define _DEBUG
#ifdef _DEBUG
#include <fstream>
class CMyTrace
{
public:
CMyTrace(const char *filename, int line)
: mFileName(filename), mLine(line)
{}
void operator()(const char *message, ...);
static void LogOn();
static void LogOff();
private:
const char *mFileName;
int mLine;
//static std::ofstream m_logFile;
static FILE * m_logFile;
static bool m_logOn;
};
#define VTRACE_ON CMyTrace::LogOn();
#define VTRACE_OFF CMyTrace::LogOff();
#define VTRACE CMyTrace(__FILE__, __LINE__)
#else
inline void __noop(...) {}
#define VTRACE_ON ;
#define VTRACE_OFF ;
#define VTRACE __noop
#endif
#endif // _MYTRACE_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -