Skip to content
Snippets Groups Projects
Commit 554e2f2f authored by Zach Hilman's avatar Zach Hilman
Browse files

reporter: Add report class for filesystem access logs

parent db2fdd03
No related branches found
No related tags found
No related merge requests found
......@@ -335,6 +335,24 @@ void Reporter::SaveErrorReport(u64 title_id, ResultCode result,
SaveToFile(std::move(out), GetPath("error_report", title_id, timestamp));
}
void Reporter::SaveFilesystemAccessReport(Service::FileSystem::LogMode log_mode,
std::string log_message) const {
if (!IsReportingEnabled())
return;
const auto timestamp = GetTimestamp();
const auto title_id = system.CurrentProcess()->GetTitleID();
json out;
out["yuzu_version"] = GetYuzuVersionData();
out["report_common"] = GetReportCommonData(title_id, RESULT_SUCCESS, timestamp);
out["log_mode"] = fmt::format("{:08X}", static_cast<u32>(log_mode));
out["log_message"] = std::move(log_message);
SaveToFile(std::move(out), GetPath("filesystem_access_report", title_id, timestamp));
}
void Reporter::SaveUserReport() const {
if (!IsReportingEnabled())
return;
......
......@@ -14,6 +14,10 @@ namespace Kernel {
class HLERequestContext;
} // namespace Kernel
namespace Service::FileSystem {
enum class LogMode : u32;
}
namespace Core {
class Reporter {
......@@ -45,6 +49,9 @@ public:
std::optional<std::string> custom_text_main = {},
std::optional<std::string> custom_text_detail = {}) const;
void SaveFilesystemAccessReport(Service::FileSystem::LogMode log_mode,
std::string log_message) const;
void SaveUserReport() const;
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment