00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00024 #ifndef __AXISLOG_H_INCLUDED_
00025 #define __AXISLOG_H_INCLUDED_
00026
00027 #include "GDefine.h"
00028 #include "AxisFile.h"
00029 #include <list>
00030 #include <string>
00031 #include <stdio.h>
00032
00033 #if defined(ENABLE_AXISTRACE)
00034 #define AXISTRACE1(X, Y) g_pAT->logaxis(X,Y,__FILE__,__LINE__);
00035 #define AXISTRACE2(X, Y, Z) g_pAT->logaxis(X,Y,Z,__FILE__,__LINE__);
00036 #define AXISTRACE3(X) g_pAT->trace(X);
00037
00038 #endif
00039 #if !defined(ENABLE_AXISTRACE)
00040 #define AXISTRACE1(X,Y) "";
00041 #define AXISTRACE2(X,Y,Z) "";
00042 #define AXISTRACE3(X) "";
00043 #endif
00044
00045
00046 using namespace std;
00047
00058 class AxisTrace
00059 {
00060 public:
00061 AxisTrace();
00062 virtual ~AxisTrace();
00063
00079 int logaxis(const char* sLog, int level, char* arg2, int arg3);
00080
00097 int logaxis(const char* sLog1, const char* sLog2, int level, char* arg3,
00098 int arg4);
00099
00116 int logaxis(const char* sLog1, const int nLog2, int level, char* arg3,
00117 int arg4);
00118
00135 int logaxis(const char* sLog1, const double dLog2, int level,
00136 char* arg3, int arg4);
00137
00146 int trace(const char* pchLog);
00147
00157 int openFile();
00158
00168 int openFileByClient();
00169
00170 private:
00171 bool m_bLoggingOn;
00172 char m_acLine[4];
00173 char* m_pcLevel;
00174 AxisFile m_fileTrace;
00175
00176 int setFilePerm(const char* pcFileName);
00177 int logthis(const char* pcLog, int level, char* arg2, int arg3);
00178
00179 };
00180
00181
00182
00183 #endif
00184