diff options
Diffstat (limited to 'src/core/reporter.cpp')
| -rw-r--r-- | src/core/reporter.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 0becdf642..f199c3362 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include "core/hle/kernel/memory/page_table.h" | 20 | #include "core/hle/kernel/memory/page_table.h" |
| 21 | #include "core/hle/kernel/process.h" | 21 | #include "core/hle/kernel/process.h" |
| 22 | #include "core/hle/result.h" | 22 | #include "core/hle/result.h" |
| 23 | #include "core/hle/service/lm/manager.h" | ||
| 24 | #include "core/memory.h" | 23 | #include "core/memory.h" |
| 25 | #include "core/reporter.h" | 24 | #include "core/reporter.h" |
| 26 | #include "core/settings.h" | 25 | #include "core/settings.h" |
| @@ -360,55 +359,6 @@ void Reporter::SaveErrorReport(u64 title_id, ResultCode result, | |||
| 360 | SaveToFile(std::move(out), GetPath("error_report", title_id, timestamp)); | 359 | SaveToFile(std::move(out), GetPath("error_report", title_id, timestamp)); |
| 361 | } | 360 | } |
| 362 | 361 | ||
| 363 | void Reporter::SaveLogReport(u32 destination, std::vector<Service::LM::LogMessage> messages) const { | ||
| 364 | if (!IsReportingEnabled()) { | ||
| 365 | return; | ||
| 366 | } | ||
| 367 | |||
| 368 | const auto timestamp = GetTimestamp(); | ||
| 369 | json out; | ||
| 370 | |||
| 371 | out["yuzu_version"] = GetYuzuVersionData(); | ||
| 372 | out["report_common"] = | ||
| 373 | GetReportCommonData(system.CurrentProcess()->GetTitleID(), RESULT_SUCCESS, timestamp); | ||
| 374 | |||
| 375 | out["log_destination"] = | ||
| 376 | fmt::format("{}", static_cast<Service::LM::DestinationFlag>(destination)); | ||
| 377 | |||
| 378 | auto json_messages = json::array(); | ||
| 379 | std::transform(messages.begin(), messages.end(), std::back_inserter(json_messages), | ||
| 380 | [](const Service::LM::LogMessage& message) { | ||
| 381 | json out; | ||
| 382 | out["is_head"] = fmt::format("{}", message.header.IsHeadLog()); | ||
| 383 | out["is_tail"] = fmt::format("{}", message.header.IsTailLog()); | ||
| 384 | out["pid"] = fmt::format("{:016X}", message.header.pid); | ||
| 385 | out["thread_context"] = | ||
| 386 | fmt::format("{:016X}", message.header.thread_context); | ||
| 387 | out["payload_size"] = fmt::format("{:016X}", message.header.payload_size); | ||
| 388 | out["flags"] = fmt::format("{:04X}", message.header.flags.Value()); | ||
| 389 | out["severity"] = fmt::format("{}", message.header.severity.Value()); | ||
| 390 | out["verbosity"] = fmt::format("{:02X}", message.header.verbosity); | ||
| 391 | |||
| 392 | auto fields = json::array(); | ||
| 393 | std::transform(message.fields.begin(), message.fields.end(), | ||
| 394 | std::back_inserter(fields), [](const auto& kv) { | ||
| 395 | json out; | ||
| 396 | out["type"] = fmt::format("{}", kv.first); | ||
| 397 | out["data"] = | ||
| 398 | Service::LM::FormatField(kv.first, kv.second); | ||
| 399 | return out; | ||
| 400 | }); | ||
| 401 | |||
| 402 | out["fields"] = std::move(fields); | ||
| 403 | return out; | ||
| 404 | }); | ||
| 405 | |||
| 406 | out["log_messages"] = std::move(json_messages); | ||
| 407 | |||
| 408 | SaveToFile(std::move(out), | ||
| 409 | GetPath("log_report", system.CurrentProcess()->GetTitleID(), timestamp)); | ||
| 410 | } | ||
| 411 | |||
| 412 | void Reporter::SaveFilesystemAccessReport(Service::FileSystem::LogMode log_mode, | 362 | void Reporter::SaveFilesystemAccessReport(Service::FileSystem::LogMode log_mode, |
| 413 | std::string log_message) const { | 363 | std::string log_message) const { |
| 414 | if (!IsReportingEnabled()) | 364 | if (!IsReportingEnabled()) |