log files moved under log folder
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
#include "Singleton.h"
|
#include "Singleton.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
const DWORD DEBUG_STRING_MAX_LEN = 1024;
|
const DWORD DEBUG_STRING_MAX_LEN = 1024;
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ class CLogFile : public CSingleton<CLogFile>
|
|||||||
|
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
m_fp = fopen("log.txt", "w");
|
m_fp = fopen("log/log.txt", "w");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(const char * c_pszMsg)
|
void Write(const char * c_pszMsg)
|
||||||
@@ -306,8 +307,12 @@ void LogFilef(const char * c_szMessage, ...)
|
|||||||
|
|
||||||
void OpenLogFile(bool bUseLogFIle)
|
void OpenLogFile(bool bUseLogFIle)
|
||||||
{
|
{
|
||||||
|
if (!std::filesystem::exists("log")) {
|
||||||
|
std::filesystem::create_directory("log");
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _DISTRIBUTE
|
#ifndef _DISTRIBUTE
|
||||||
freopen("syserr.txt", "w", stderr);
|
freopen("log/syserr.txt", "w", stderr);
|
||||||
|
|
||||||
if (bUseLogFIle)
|
if (bUseLogFIle)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS* pExceptionInfo)
|
|||||||
HANDLE hProcess = GetCurrentProcess();
|
HANDLE hProcess = GetCurrentProcess();
|
||||||
HANDLE hThread = GetCurrentThread();
|
HANDLE hThread = GetCurrentThread();
|
||||||
|
|
||||||
fException = fopen("ErrorLog.txt", "wt");
|
fException = fopen("log/ErrorLog.txt", "wt");
|
||||||
if (fException)
|
if (fException)
|
||||||
{
|
{
|
||||||
char module_name[256];
|
char module_name[256];
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ bool PackInitialize(const char * c_pszFolder)
|
|||||||
{
|
{
|
||||||
NANOBEGIN
|
NANOBEGIN
|
||||||
if (_access(c_pszFolder, 0) != 0)
|
if (_access(c_pszFolder, 0) != 0)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
std::string stFolder(c_pszFolder);
|
std::string stFolder(c_pszFolder);
|
||||||
stFolder += "/";
|
stFolder += "/";
|
||||||
|
|||||||
Reference in New Issue
Block a user