#define TRACE_PRINT(pszFmt, ...) \
do {  \
       FILE* file ; \
      if (0 == _tfopen_s(&file, _T("shmm.error.log"), _T("a")))  \
          {  \
                TCHAR sdate[32] ,stime[32]; \
                _strdate_s(sdate, 32) ;     \
                _strtime_s(stime, 32) ;     \
                _ftprintf_s(file,_T(" DateTime : %s %s : FILE:%s - FUN:%s - LINE:%d \r\n MESSAGE  : ") ##pszFmt _T("\r\n") , \
                                      sdate ,stime, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);                        \
              fclose(file);                   \
          }   \
   }while (0) 

 

posted on 2018-04-11 17:31  静观海月  阅读(512)  评论(0编辑  收藏  举报