📄 stdafx.cpp
字号:
// stdafx.cpp : source file that includes just the standard includes
// GWservice.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
void AddLog(const char* format,...)
{
FILE* pfLog;
char current[36];
char tp[36];
struct _timeb timebuffer;
char lpFileName[MAX_PATH];
_strdate(current);
_ftime(&timebuffer);
strcpy(tp,ctime(&(timebuffer.time)));
current[2]='_';
current[5]=0;
tp[strlen(tp)-1]=0;
GetModuleFileName(NULL,lpFileName,MAX_PATH);
#if MONTH_LOG
sprintf(strrchr(lpFileName,'\\')+1,
"Service%s_%.2s.txt\0",strrchr(tp,' ')+1,current);
#else
sprintf(strrchr(lpFileName,'\\')+1,
"Log%s_%s.txt\0",strrchr(tp,' ')+1,current);
#endif
current[2]='-';
tp[strrchr(tp,' ')-tp]=0;
pfLog=fopen(lpFileName,"a");
va_list args;
va_start(args,format);
#if _DEBUG
vfprintf(stdout,format,args);
#endif
fprintf(pfLog,"%s<%s.%.3u> ",current,
strrchr(tp,' ')+1,timebuffer.millitm);
vfprintf(pfLog,format,args);
va_end(args);
fflush(pfLog);
fclose(pfLog);
}
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -