mirror of
https://github.com/moonlight-stream/Internet-Hosting-Tool.git
synced 2026-06-18 14:41:04 +00:00
Print both old and new MISS logs
This commit is contained in:
+22
-4
@@ -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];
|
||||||
|
FILE* f;
|
||||||
|
|
||||||
|
printf("--------------- CURRENT MISS LOG -------------------\n");
|
||||||
|
|
||||||
char missPath[MAX_PATH + 1];
|
|
||||||
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,9 +86,25 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user