?? trace.h
字號:
#ifndef __TRACE_H__
#define __TRACE_H__
#define COMPILER_IS_VS2003 0
#define MAX_LOG_STR_LENGTH 512
#define MAX_SYSTEM_TIME_BUF_LENGTH 64
#define MAX_FUNC_NAME_LENGTH 32
const unsigned long TRACE_LEVEL_ENTER_OPEN = 0x00000001;
const unsigned long TRACE_LEVEL_RETURN_OPEN = 0x00000002;
const unsigned long TRACE_LEVEL_PARAM_OPEN = 0x00000004;
const unsigned long TRACE_LEVEL_INFO_OPEN = 0x00000008;
const unsigned long TRACE_LEVEL_DEBUG_OPEN[] =
{
0x00000010, // DEBUG1
0x00000020, // DEBUG2
0x00000040, // DEBUG3
0x00000080, // DEBUG4
0x00000100, // DEBUG5
0x00000200, // DEBUG6
0x00000400, // DEBUG7
0x00000800, // DEBUG8
0x00001000, // DEBUG9
};
const unsigned long TRACE_LEVEL_ERROR_OPEN = 0x00002000;
const unsigned long TRACE_TO_FILE_ENTER_OPEN = 0x00000001;
const unsigned long TRACE_TO_FILE_RETURN_OPEN = 0x00000002;
const unsigned long TRACE_TO_FILE_PARAM_OPEN = 0x00000004;
const unsigned long TRACE_TO_FILE_INFO_OPEN = 0x00000008;
const unsigned long TRACE_TO_FILE_DEBUG_OPEN[]=
{
0x00000010, // DEBUG1
0x00000020, // DEBUG2
0x00000040, // DEBUG3
0x00000080, // DEBUG4
0x00000100, // DEBUG5
0x00000200, // DEBUG6
0x00000400, // DEBUG7
0x00000800, // DEBUG8
0x00001000, // DEBUG9
};
const unsigned long TRACE_TO_FILE_ERROR_OPEN = 0x00002000;
void setTraceLevel(unsigned long traceLevelFlags);
void setTraceOutputMode(unsigned long traceOutputMode);
void setSystemTimeOn(unsigned long isSystemTimeOn);
void initTraceCfg(unsigned long traceOutputMode,unsigned long traceLevelFlags,unsigned long isSystemTimeOn);
void getSysTime(char systemTimeBuffer[MAX_SYSTEM_TIME_BUF_LENGTH]);
void LogOutput(char* logStr);
bool _Enter(const char*format,...);
bool _Return(const char*format,...);
bool _Param(const char*format,...);
bool _Info(const char*format,...);
bool _Debug(int level, const char* format,...);
bool _Error(const char*format,...);
char* getFuncName(char name[]);
int getLineNumber(int line);
char* getFileName(char file[]);
#define tEnter getFuncName(__FUNCTION__) != NULL && \
getLineNumber(__LINE__) >= 0 && \
getFileName(__FILE__) != NULL && _Enter
#define tReturn getFuncName(__FUNCTION__) != NULL && \
getLineNumber(__LINE__) >= 0 && \
getFileName(__FILE__) != NULL && _Return
#define tParam getFuncName(__FUNCTION__) != NULL && \
getLineNumber(__LINE__) >= 0 && \
getFileName(__FILE__) != NULL && _Param
#define tInfo getFuncName(__FUNCTION__) != NULL && \
getLineNumber(__LINE__) >= 0 && \
getFileName(__FILE__) != NULL && _Info
#define tDebug getFuncName(__FUNCTION__) != NULL && \
getLineNumber(__LINE__) >= 0 && \
getFileName(__FILE__) != NULL && _Debug
#define tError getFuncName(__FUNCTION__) != NULL && \
getLineNumber(__LINE__) >= 0 && \
getFileName(__FILE__) != NULL && _Error
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -