[SYSSETUP]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 22 Feb 2014 13:58:33 +0000 (13:58 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 22 Feb 2014 13:58:33 +0000 (13:58 +0000)
Add date/time to setuplog.txt. Patch by Lee Schroeder. Thanks a lot!
CORE-7927 #resolve

svn path=/trunk/; revision=62289

reactos/dll/win32/syssetup/logfile.c

index ea0db8e..5a941d0 100644 (file)
@@ -97,6 +97,8 @@ SYSSETUP_LogItem(IN const LPSTR lpFileName,
     DWORD dwMessageSize;
     DWORD dwWritten;
     CHAR Buffer[6];
+    CHAR TimeBuffer[30];
+    SYSTEMTIME stTime;
 
     /* Get the severity code string */
     switch (dwSeverity)
@@ -148,6 +150,28 @@ SYSSETUP_LogItem(IN const LPSTR lpFileName,
                    NULL,
                    FILE_END);
 
+    /* Write Time/Date */
+    GetLocalTime(&stTime);
+
+    snprintf(TimeBuffer, sizeof(TimeBuffer),
+             "%02d/%02d/%02d %02d:%02d:%02d.%03d",
+             stTime.wMonth,
+             stTime.wDay,
+             stTime.wYear,
+             stTime.wHour,
+             stTime.wMinute,
+             stTime.wSecond,
+             stTime.wMilliseconds);
+
+    WriteFile(hLogFile,
+              TimeBuffer,
+              strlen(TimeBuffer),
+              &dwWritten,
+              NULL);
+
+    /* Write comma */
+    WriteFile(hLogFile, ",", 1, &dwWritten, NULL);
+
     /* Write file name */
     WriteFile(hLogFile,
               lpFileName,