diff --git a/src/EterBase/Debug.cpp b/src/EterBase/Debug.cpp index 74f0191..1427eb9 100644 --- a/src/EterBase/Debug.cpp +++ b/src/EterBase/Debug.cpp @@ -5,6 +5,7 @@ #include "Debug.h" #include "Singleton.h" #include "Timer.h" +#include const DWORD DEBUG_STRING_MAX_LEN = 1024; @@ -28,7 +29,7 @@ class CLogFile : public CSingleton void Initialize() { - m_fp = fopen("log.txt", "w"); + m_fp = fopen("log/log.txt", "w"); } void Write(const char * c_pszMsg) @@ -306,8 +307,12 @@ void LogFilef(const char * c_szMessage, ...) void OpenLogFile(bool bUseLogFIle) { + if (!std::filesystem::exists("log")) { + std::filesystem::create_directory("log"); + } + #ifndef _DISTRIBUTE - freopen("syserr.txt", "w", stderr); + freopen("log/syserr.txt", "w", stderr); if (bUseLogFIle) { diff --git a/src/EterBase/error.cpp b/src/EterBase/error.cpp index 7737884..bc30952 100644 --- a/src/EterBase/error.cpp +++ b/src/EterBase/error.cpp @@ -44,7 +44,7 @@ LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS* pExceptionInfo) HANDLE hProcess = GetCurrentProcess(); HANDLE hThread = GetCurrentThread(); - fException = fopen("ErrorLog.txt", "wt"); + fException = fopen("log/ErrorLog.txt", "wt"); if (fException) { char module_name[256]; diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp index 835da54..1efed76 100644 --- a/src/UserInterface/UserInterface.cpp +++ b/src/UserInterface/UserInterface.cpp @@ -144,7 +144,7 @@ bool PackInitialize(const char * c_pszFolder) { NANOBEGIN if (_access(c_pszFolder, 0) != 0) - return true; + return false; std::string stFolder(c_pszFolder); stFolder += "/";