Commit 559b2c8e authored by captainwong's avatar captainwong

ready to upgrade

parent 9bd97ff8
...@@ -57,6 +57,7 @@ namespace jlib ...@@ -57,6 +57,7 @@ namespace jlib
class CLog class CLog
{ {
private: private:
#pragma region private members
double exe_time; double exe_time;
LARGE_INTEGER freq; LARGE_INTEGER freq;
LARGE_INTEGER start_t, stop_t; LARGE_INTEGER start_t, stop_t;
...@@ -75,17 +76,12 @@ namespace jlib ...@@ -75,17 +76,12 @@ namespace jlib
static char m_ansiBuf[MAX_OUTPUT_LEN]; static char m_ansiBuf[MAX_OUTPUT_LEN];
static wchar_t m_utf16Buf[MAX_OUTPUT_LEN]; static wchar_t m_utf16Buf[MAX_OUTPUT_LEN];
static CLog* m_pInstance; static CLog* m_pInstance;
#pragma endregion
public: public:
static const wchar_t* GetPrivateLogPath() #pragma region public functions
{
static wchar_t strPrivateMapFolder[1024] = { 0 }; static const wchar_t* GetLogFilePath() { return g_szFileName; }
static BOOL b = TRUE;
if (b) {
wsprintf(strPrivateMapFolder, _T("%s\\Log"), GetModuleFilePath());
b = FALSE;
}
return strPrivateMapFolder;
}
static CLog* GetInstance() static CLog* GetInstance()
{ {
...@@ -313,7 +309,10 @@ namespace jlib ...@@ -313,7 +309,10 @@ namespace jlib
} }
} }
#pragma endregion
protected: protected:
#pragma region protected functions
CLog() : m_pLogFile(NULL), m_bOutputLogFile(FALSE), m_bOutputDbgView(FALSE), CLog() : m_pLogFile(NULL), m_bOutputLogFile(FALSE), m_bOutputDbgView(FALSE),
m_bOutputConsole(FALSE), m_bConsoleOpened(FALSE), m_bDbgviewOpened(FALSE), m_bOutputConsole(FALSE), m_bConsoleOpened(FALSE), m_bDbgviewOpened(FALSE),
m_bLogFileOpened(FALSE), m_bRunning(TRUE) m_bLogFileOpened(FALSE), m_bRunning(TRUE)
...@@ -348,6 +347,17 @@ namespace jlib ...@@ -348,6 +347,17 @@ namespace jlib
return szTime; return szTime;
} }
static const wchar_t* GetPrivateLogPath()
{
static wchar_t strPrivateMapFolder[1024] = { 0 };
static BOOL b = TRUE;
if (b) {
wsprintf(strPrivateMapFolder, _T("%s\\Log"), GetModuleFilePath());
b = FALSE;
}
return strPrivateMapFolder;
}
void Output(const TCHAR *out) void Output(const TCHAR *out)
{ {
if (m_bOutputLogFile) { if (m_bOutputLogFile) {
...@@ -527,6 +537,7 @@ namespace jlib ...@@ -527,6 +537,7 @@ namespace jlib
} }
}; };
#pragma endregion
}; };
//CRITICAL_SECTION CLog::m_cs; //CRITICAL_SECTION CLog::m_cs;
//int CLog::m_nRef = 0; //int CLog::m_nRef = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment