00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __AXISLOG_H_INCLUDED_
00018 #define __AXISLOG_H_INCLUDED_
00019
00020 #include "GDefine.h"
00021 #include "AxisFile.h"
00022 #include <list>
00023 #include <string>
00024 #include <stdio.h>
00025
00026 #if defined(ENABLE_AXISTRACE)
00027 #define AXISTRACE1(X, Y) g_pAT->logaxis(X,Y,__FILE__,__LINE__);
00028 #define AXISTRACE2(X, Y, Z) g_pAT->logaxis(X,Y,Z,__FILE__,__LINE__);
00029 #define AXISTRACE3(X) g_pAT->trace(X);
00030
00031 #endif
00032 #if !defined(ENABLE_AXISTRACE)
00033 #define AXISTRACE1(X,Y) "";
00034 #define AXISTRACE2(X,Y,Z) "";
00035 #define AXISTRACE3(X) "";
00036 #endif
00037
00038
00039 using namespace std;
00040
00051 class AxisTrace
00052 {
00053 public:
00054 AxisTrace();
00055 virtual ~AxisTrace();
00056
00072 int logaxis(const char* sLog, int level, char* arg2, int arg3);
00073
00090 int logaxis(const char* sLog1, const char* sLog2, int level, char* arg3,
00091 int arg4);
00092
00109 int logaxis(const char* sLog1, const int nLog2, int level, char* arg3,
00110 int arg4);
00111
00128 int logaxis(const char* sLog1, const double dLog2, int level,
00129 char* arg3, int arg4);
00130
00139 int trace(const char* pchLog);
00140
00150 int openFile();
00151
00161 int openFileByClient();
00162
00163 private:
00164 bool m_bLoggingOn;
00165 char m_acLine[4];
00166 char* m_pcLevel;
00167 AxisFile m_fileTrace;
00168
00169 int setFilePerm(const char* pcFileName);
00170 int logthis(const char* pcLog, int level, char* arg2, int arg3);
00171
00172 };
00173
00174
00175
00176 #endif
00177