Skip to content

Commit

Permalink
Merge pull request #19943 from hrydgard/another-log-fix
Browse files Browse the repository at this point in the history
Second attempt at fixing #19935
  • Loading branch information
hrydgard authored Feb 3, 2025
2 parents 5fa1212 + d39655f commit e809414
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Core/HLE/HLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,11 +1070,21 @@ void hleDoLogInternal(Log t, LogLevel level, u64 res, const char *file, int line
if (reportTag[0] == '\0' || Reporting::ShouldLogNTimes(reportTag, 1)) {
// Here we want the original key, so that different args, etc. group together.
std::string key = std::string(kernelFlag) + std::string("%08x=") + funcName + "(%s)";
if (reason != nullptr)
key += std::string(": ") + reason;
if (reason != nullptr) {
key += ": ";
key += reason;
}

char formatted_message[8192];
snprintf(formatted_message, sizeof(formatted_message), fmt, kernelFlag, res, funcName, formatted_args, formatted_reason);
if (retmask != 'v') {
if (errStr) {
snprintf(formatted_message, sizeof(formatted_message), fmt, kernelFlag, errStr, funcName, formatted_args, formatted_reason);
} else {
snprintf(formatted_message, sizeof(formatted_message), fmt, kernelFlag, res, funcName, formatted_args, formatted_reason);
}
} else {
snprintf(formatted_message, sizeof(formatted_message), fmt, kernelFlag, funcName, formatted_args, formatted_reason);
}
Reporting::ReportMessageFormatted(key.c_str(), formatted_message);
}
}
Expand Down

0 comments on commit e809414

Please sign in to comment.