|
@@ -988,9 +988,15 @@ namespace GLOBAL
|
|
|
void WriteTextLog(const TCHAR* format, ...)
|
|
|
{
|
|
|
AutoThreadSection aSection(&g_csTextLog);
|
|
|
+
|
|
|
+ __time64_t gmt = time(NULL);
|
|
|
+ struct tm gmtm = { 0 };
|
|
|
+ localtime_s(&gmtm, &gmt);
|
|
|
+
|
|
|
|
|
|
TCHAR szlogpath[MAX_PATH] = { 0 };
|
|
|
- _stprintf_s(szlogpath, _T("%s%s.txt"), g_szCurModuleDir, g_szFna);
|
|
|
+
|
|
|
+ _stprintf_s(szlogpath, _T("%s%s\\SATHTTP-%04d-%02d.txt"), g_szCurModuleDir, "log", gmtm.tm_year + 1900, gmtm.tm_mon + 1);
|
|
|
|
|
|
FILE* fp = NULL;
|
|
|
if (_taccess(szlogpath, 0) != -1)
|
|
@@ -1021,10 +1027,6 @@ namespace GLOBAL
|
|
|
buffer = (TCHAR*)malloc(len * sizeof(TCHAR));
|
|
|
_vstprintf_s(buffer, len, format, args);
|
|
|
|
|
|
-
|
|
|
- __time64_t gmt = time(NULL);
|
|
|
- struct tm gmtm = { 0 };
|
|
|
- localtime_s(&gmtm, &gmt);
|
|
|
_ftprintf(fp, _T("%04d-%02d-%02d %02d:%02d:%02d %s\n"), gmtm.tm_year + 1990, gmtm.tm_mon + 1, gmtm.tm_mday, gmtm.tm_hour, gmtm.tm_min, gmtm.tm_sec, buffer);
|
|
|
|
|
|
|