Main Page   Class Hierarchy   Compound List   File List   Compound Members   Examples  

AxisTrace.h

00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
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 /* static AxisTrace tracer; */
00175 
00176 #endif
00177 

Generated on Tue Jun 15 19:13:22 2004 for axiscpp by doxygen1.2.18