|
@@ -80,7 +80,7 @@ static void WLog_Uninit_(void) __attribute__((destructor));
|
|
|
#include <windows.h>
|
|
|
#include <tchar.h>
|
|
|
char* get_process_name() {
|
|
|
- // 拼接前缀、进程名和后缀
|
|
|
+ // 鎷兼帴鍓嶇紑銆佽繘绋嬪悕鍜屽悗缂€
|
|
|
char date_str[MAX_PATH];
|
|
|
char* full_path = malloc(MAX_PATH);
|
|
|
|
|
@@ -94,10 +94,10 @@ char* get_process_name() {
|
|
|
|
|
|
snprintf(full_path, MAX_PATH, "%s\\wlog_%s.log", g_logRoot, date_str);
|
|
|
//MessageBox(NULL, full_path, NULL, 0);
|
|
|
- // 检查文件是否存在
|
|
|
+ // 妫€鏌ユ枃浠舵槸鍚﹀瓨鍦�
|
|
|
FILE* fp = fopen(full_path, "r");
|
|
|
if (!fp) {
|
|
|
- // 创建文件
|
|
|
+ // 鍒涘缓鏂囦欢
|
|
|
fp = fopen(full_path, "w");
|
|
|
if (!fp) {
|
|
|
printf("Failed to create file: %s\n", full_path);
|
|
@@ -131,7 +131,7 @@ void WLog_WriteLogFile(int type, const char* fmt, ...)
|
|
|
GetSystemTimePreciseAsFileTime(&ft);
|
|
|
FileTimeToSystemTime(&ft, &st);
|
|
|
|
|
|
- // 将 UTC 时间转换为本地时间
|
|
|
+ // 灏� UTC 鏃堕棿杞�崲涓烘湰鍦版椂闂�
|
|
|
SYSTEMTIME local_st;
|
|
|
FileTimeToLocalFileTime(&ft, &ft);
|
|
|
FileTimeToSystemTime(&ft, &local_st);
|
|
@@ -153,7 +153,7 @@ void WLog_WriteLogFile(int type, const char* fmt, ...)
|
|
|
pFile = fopen(path, "a");
|
|
|
if (!pFile) {
|
|
|
pFile = NULL;
|
|
|
- // 错误处理
|
|
|
+ // 閿欒�澶勭悊
|
|
|
return;
|
|
|
}
|
|
|
}
|