00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef zz_log_h
00010 #define zz_log_h
00011
00012 #include <rislog.h>
00013 #include <zz_string.h>
00014 #include <zz_export.h>
00015
00016 #ifdef _WIN32
00017 #include <zz_win_threadmutex.h>
00018 #endif
00019
00020
00021 #define _INFOPARAMS LL_INFO , 0, __LINE__, __FILE__
00022
00023
00024 #define _TRACEPARAMS LL_TRACE , 0, __LINE__, __FILE__
00025
00026
00027 #define _DEBUGPARAMS LL_DEBUG , 0, __LINE__, __FILE__
00028
00029
00030 #define _WARNINGPARAMS LL_WARNING, 0, __LINE__, __FILE__
00031
00032
00033 #ifndef _LAF
00034
00035 #define _LAF __LINE__, __FILE__
00036 #endif
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 class ZZ_API CzzLog
00058 {
00059
00060 public:
00061
00062
00063
00064
00065
00066
00067
00068
00069 CzzLog( void );
00070
00071
00072
00073
00074
00075 CzzLog( const CzzString& app
00076 );
00077
00078 CzzLog( const CzzString& app,
00079 const CzzString& ini );
00080
00081
00082
00083
00084
00085 CzzLog( CzzLog& obj
00086 );
00087
00088
00089 ~CzzLog();
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 LOGRET Print( const LOGLEVEL Level,
00106 const int ErrorCode,
00107 const int Row,
00108 const char* Module,
00109 const char* Message,
00110 ...
00111 );
00112
00113
00114 HLOG GetHandle();
00115
00116 private:
00117
00118 void Init( const CzzString& app );
00119 void Init( const CzzString& app, const CzzString& ini );
00120 static HLOG m_Handle;
00121 static short m_cRefs;
00122
00123 #ifdef _WIN32
00124 static CzzWinThreadMutex m_Mutex;
00125 #endif
00126
00127 };
00128
00129 #endif
00130