From 20734d0fdaefe16a67511bdf8fe6e295c02f27dc Mon Sep 17 00:00:00 2001
From: kojingeun <diteam.co.kr>
Date: 월, 19 6월 2023 16:25:31 +0900
Subject: [PATCH] Ongoing60 #4517 CF AOI Review 결과 파일 찾기 실패 개선 1. Find Bin File 무조건 실패하는 버그 개선

---
 ReviewSystem/ReviewSystem/DisplayMessage.cpp |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/ReviewSystem/ReviewSystem/DisplayMessage.cpp b/ReviewSystem/ReviewSystem/DisplayMessage.cpp
index 1555229..f8e08c6 100644
--- a/ReviewSystem/ReviewSystem/DisplayMessage.cpp
+++ b/ReviewSystem/ReviewSystem/DisplayMessage.cpp
@@ -33,7 +33,9 @@
 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();
@@ -42,6 +44,10 @@
 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;
 
@@ -78,13 +84,20 @@
 {
 	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);
 // 
@@ -123,7 +136,8 @@
 		// �쑀�땲肄붾뱶 �뙆�씪�쓽 �떆�옉�� BOM(0xFEFF) �씠�뼱�빞 �븳�떎.
 		TCHAR strCommand = 0xFEFF;
 		CString strLog = _T("");
-		strTimeStamp.Format(_T("[%02d:%02d:%02d]"), time.GetHour(), time.GetMinute(), time.GetSecond());
+		//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());
 #ifdef UNICODE
 		strLog.Format(_T("%c%s %s\r\n"), strCommand, strTimeStamp, strMessage);
 #else
@@ -151,6 +165,7 @@
 		case WM_DIPLAY_LOG:
 			
 			g_pLog->ThreadDisplayMessage(*pstrLog);
+			delete pstrLog;
 			break;
 
 		default:

--
Gitblit v1.9.3