Lines 686-712
Link Here
|
686 |
|
686 |
|
687 |
char *MscLogFilePath(char const *pszLogFile, char *pszLogFilePath) |
687 |
char *MscLogFilePath(char const *pszLogFile, char *pszLogFilePath) |
688 |
{ |
688 |
{ |
689 |
time_t tCurrent; |
|
|
690 |
|
691 |
time(&tCurrent); |
692 |
|
693 |
long lRotStep = (unsigned long) (3600L * iLogRotateHours); |
694 |
long lTimeZone = SysGetTimeZone(); |
695 |
long lDayLight = SysGetDayLight(); |
696 |
time_t tLogFileTime = (time_t) (NbrFloor((SYS_INT64) tCurrent - lTimeZone + lDayLight, |
697 |
lRotStep) + lTimeZone - lDayLight); |
698 |
struct tm tmLocTime; |
699 |
char szLogsDir[SYS_MAX_PATH] = ""; |
689 |
char szLogsDir[SYS_MAX_PATH] = ""; |
700 |
|
690 |
|
701 |
SysLocalTime(&tLogFileTime, &tmLocTime); |
|
|
702 |
|
703 |
SvrGetLogsDir(szLogsDir, sizeof(szLogsDir)); |
691 |
SvrGetLogsDir(szLogsDir, sizeof(szLogsDir)); |
704 |
AppendSlash(szLogsDir); |
692 |
AppendSlash(szLogsDir); |
705 |
|
693 |
|
706 |
sprintf(pszLogFilePath, "%s%s-%04d%02d%02d%02d%02d", |
694 |
sprintf(pszLogFilePath, "%s%s.log", |
707 |
szLogsDir, pszLogFile, |
695 |
szLogsDir, pszLogFile); |
708 |
tmLocTime.tm_year + 1900, |
|
|
709 |
tmLocTime.tm_mon + 1, tmLocTime.tm_mday, tmLocTime.tm_hour, tmLocTime.tm_min); |
710 |
|
696 |
|
711 |
return pszLogFilePath; |
697 |
return pszLogFilePath; |
712 |
} |
698 |
} |
713 |
|
699 |
|