Print both old and new MISS logs

This commit is contained in:
Cameron Gutman
2019-03-28 19:46:34 -07:00
parent 1bc6cc5634
commit 771e09973f
+22 -4
View File
@@ -70,11 +70,13 @@ void DisplayMessage(const char* message, const char* helpUrl = nullptr, MessageP
printf("%s\n", message); printf("%s\n", message);
if (terminal) { if (terminal) {
printf("--------------- MISS LOG -------------------\n");
char missPath[MAX_PATH + 1]; char missPath[MAX_PATH + 1];
FILE* f;
printf("--------------- CURRENT MISS LOG -------------------\n");
ExpandEnvironmentStringsA("%ProgramData%\\MISS\\miss-current.log", missPath, sizeof(missPath)); ExpandEnvironmentStringsA("%ProgramData%\\MISS\\miss-current.log", missPath, sizeof(missPath));
FILE* f = fopen(missPath, "r"); f = fopen(missPath, "r");
if (f != nullptr) { if (f != nullptr) {
char buffer[1024]; char buffer[1024];
while (!feof(f)) { while (!feof(f)) {
@@ -84,7 +86,23 @@ void DisplayMessage(const char* message, const char* helpUrl = nullptr, MessageP
fclose(f); fclose(f);
} }
else { else {
printf("Failed to find MISS log\n"); printf("Failed to find current MISS log\n");
}
printf("\n----------------- OLD MISS LOG ---------------------\n");
ExpandEnvironmentStringsA("%ProgramData%\\MISS\\miss-old.log", missPath, sizeof(missPath));
f = fopen(missPath, "r");
if (f != nullptr) {
char buffer[1024];
while (!feof(f)) {
int bytesRead = fread(buffer, 1, ARRAYSIZE(buffer), f);
fwrite(buffer, 1, bytesRead, stdout);
}
fclose(f);
}
else {
printf("Failed to find old MISS log\n");
} }
fflush(stdout); fflush(stdout);