Skip to content

Commit

Permalink
Add CPU information to error reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticial committed Dec 18, 2024
1 parent e98f3f6 commit 7bce796
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "CommonFramework/GlobalSettingsPanel.h"
#include "CommonFramework/Logging/Logger.h"
#include "CommonFramework/Notifications/ProgramNotifications.h"
#include "CommonFramework/Environment/Environment.h"
#include "CommonFramework/Options/Environment/ThemeSelectorOption.h"
#include "CommonFramework/Tools/ConsoleHandle.h"
#include "ProgramDumper.h"
Expand Down Expand Up @@ -96,6 +97,7 @@ ErrorReportOption::ErrorReportOption()
SendableErrorReport::SendableErrorReport()
: m_timestamp(now_to_filestring())
, m_directory(ERROR_PATH_UNSENT + "/" + m_timestamp + "/")
, m_processor(get_processor_name())
, m_program(PreloadSettings::instance().DEVELOPER_MODE
? PROGRAM_NAME + " (" + PROGRAM_VERSION + "-dev)"
: PROGRAM_NAME + " (" + PROGRAM_VERSION + ")"
Expand Down Expand Up @@ -161,6 +163,7 @@ SendableErrorReport::SendableErrorReport(std::string directory)
JsonValue json = load_json_file(m_directory + "Report.json");
const JsonObject& obj = json.to_object_throw();
m_timestamp = obj.get_string_throw("Timestamp");
m_processor = obj.get_string_throw("Processor");
m_program = obj.get_string_throw("Program");
m_program_id = obj.get_string_throw("ProgramID");
m_program_runtime_millis = obj.get_integer_throw("ElapsedTimeMillis");
Expand Down Expand Up @@ -226,6 +229,7 @@ void SendableErrorReport::save(Logger* logger) const{
JsonObject report;

report["Timestamp"] = m_timestamp;
report["Processor"] = m_processor;
report["Program"] = m_program;
report["ProgramID"] = m_program_id;
report["ElapsedTimeMillis"] = m_program_runtime_millis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class SendableErrorReport{
private:
std::string m_timestamp;
std::string m_directory;
std::string m_processor;
std::string m_program;
std::string m_program_id;
uint64_t m_program_runtime_millis;
Expand Down

0 comments on commit 7bce796

Please sign in to comment.