| | |
| | | void CDisplayMessage::SetPath(const CString& strPath) |
| | | { |
| | | m_strLogPath = strPath; |
| | | |
| | | CString m_GlobalLogPath; |
| | | m_strLogFile.Format(_T("D:\\DIT_LogData\\%04d%02d%02d"), m_strLogPath, m_TimeLogFile.GetYear(), m_TimeLogFile.GetMonth(), m_TimeLogFile.GetDay()); |
| | | CreateDirectory(m_strLogFile, NULL); |
| | | CreateDirectory(m_strLogPath, NULL); |
| | | |
| | | MakeLogFile(); |
| | |
| | | BOOL CDisplayMessage::MakeLogFile() |
| | | { |
| | | // Log 처리 |
| | | CString m_GlobalLogPath; |
| | | m_strLogFile.Format(_T("D:\\DIT_LogData\\%04d%02d%02d"), m_TimeLogFile.GetYear(), m_TimeLogFile.GetMonth(), m_TimeLogFile.GetDay()); |
| | | CreateDirectory(m_strLogFile, NULL); |
| | | |
| | | if (m_strLogPath.IsEmpty()) |
| | | return FALSE; |
| | | |
| | |
| | | { |
| | | va_list list; |
| | | TCHAR strText[2000] = {0}; |
| | | try |
| | | { |
| | | va_start(list, lpstrFormat); |
| | | _vstprintf_s(strText, lpstrFormat, list); |
| | | va_end(list); |
| | | |
| | | va_start(list, lpstrFormat); |
| | | _vstprintf_s(strText, lpstrFormat, list); |
| | | va_end(list); |
| | | CString* pstrLog = new CString(strText); |
| | | PostThreadMessage(m_ThreadId, WM_DIPLAY_LOG, reinterpret_cast<WPARAM>(pstrLog), 0); |
| | | } |
| | | catch (...) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | CString* pstrLog = new CString(strText); |
| | | PostThreadMessage(m_ThreadId, WM_DIPLAY_LOG, reinterpret_cast<WPARAM>(pstrLog), 0); |
| | | |
| | | // WriteToFile(strText); |
| | | // |
| | |
| | | TCHAR strCommand = 0xFEFF; |
| | | CString strLog = _T(""); |
| | | //strTimeStamp.Format(_T("[%02d:%02d:%02d]"), time.GetHour(), time.GetMinute(), time.GetSecond()); |
| | | strTimeStamp.Format(_T("[%02d:%02d:%02d:%02d:%02d:%02d]"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond()); |
| | | /*< SWK 20221221 - #4403 MOD Start >*/ |
| | | // strTimeStamp.Format(_T("[%02d:%02d:%02d_%02d:%02d:%02d]"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond()); |
| | | SYSTEMTIME currentTime; |
| | | ::GetLocalTime(¤tTime); |
| | | strTimeStamp.Format(_T("[%02d:%02d:%02d_%02d:%02d:%02d.%03d]"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond(), currentTime.wMilliseconds); |
| | | /*< SWK 20221221 - #4403 MOD End >*/ |
| | | #ifdef UNICODE |
| | | strLog.Format(_T("%c%s %s\r\n"), strCommand, strTimeStamp, strMessage); |
| | | #else |
| | |
| | | case WM_DIPLAY_LOG: |
| | | |
| | | g_pLog->ThreadDisplayMessage(*pstrLog); |
| | | delete pstrLog; |
| | | break; |
| | | |
| | | default: |