Changeset 1631
- Timestamp:
- 09/22/08 13:24:42 (4 months ago)
- Files:
-
- trunk/LibXPort/include/LibXPort/Log.h (modified) (2 diffs)
- trunk/LibXPort/src/Log.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/LibXPort/include/LibXPort/Log.h
r1630 r1631 31 31 typedef enum { ALL, DEBUG, SPECIAL } build_t; 32 32 33 CLog(); 33 34 CLog(const char *sFile, bool bClobber = false); 34 35 ~CLog(); 35 36 37 bool Init(const char *sFile, bool bClobber = false); 36 38 void Log(const wchar_t *sMessage, const wchar_t *Source, level_t eLevel = TRACE, build_t eCondition = ALL); 37 39 void LogAll(const wchar_t *sMessage, const wchar_t *sSource, level_t eLevel = TRACE); … … 41 43 42 44 private: 43 CLog();44 45 CLog(const CLog &rhs); 45 46 CLog &operator=(const CLog &rhs); trunk/LibXPort/src/Log.cpp
r1626 r1631 20 20 using namespace LibXPort; 21 21 22 CLog::CLog() 23 { 24 } 25 22 26 CLog::CLog(const char *sFile, bool bClobber) 23 27 : m_f(sFile, std::ios_base::app | std::ios_base::out | (bClobber ? std::ios_base::trunc : 0)) … … 31 35 } 32 36 37 bool CLog::Init(const char *sFile, bool bClobber) 38 { 39 if(!m_f.is_open()) 40 { 41 m_f.open(sFile, std::ios_base::app | std::ios_base::out | (bClobber ? std::ios_base::trunc : 0)); 42 return m_f.is_open(); 43 } 44 45 return false; 46 } 47 33 48 const std::wstring CLog::cm_sTrace = L"[TRACE]"; 34 49 const std::wstring CLog::cm_sWarning = L"[WARNING]";