mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 17:23:40 +01:00
Debugger: Synchronize error events using tickets.
This commit is contained in:
1 parent
b37d59e8fa
commit
123723286d
2 files changed
+33
-4
No files matched your search
@@ -24,11 +24,19 @@
|
||||
#include "Common/Log.h"
|
||||
|
||||
struct DebuggerErrorEvent {
|
||||
DebuggerErrorEvent(const std::string m, LogTypes::LOG_LEVELS l) : message(m), level(l) {
|
||||
DebuggerErrorEvent(const std::string m, LogTypes::LOG_LEVELS l, const JsonGet data = JsonValue(JSON_NULL))
|
||||
: message(m), level(l) {
|
||||
// Need to format right away, before it's out of scope.
|
||||
if (data) {
|
||||
const JsonNode *value = data.get("ticket");
|
||||
if (value)
|
||||
ticketRaw = json_stringify(value);
|
||||
}
|
||||
}
|
||||
|
||||
std::string message;
|
||||
LogTypes::LOG_LEVELS level;
|
||||
std::string ticketRaw;
|
||||
|
||||
operator std::string() {
|
||||
JsonWriter j;
|
||||
@@ -36,6 +44,9 @@ struct DebuggerErrorEvent {
|
||||
j.writeString("event", "error");
|
||||
j.writeString("message", message);
|
||||
j.writeInt("level", level);
|
||||
if (!ticketRaw.empty()) {
|
||||
j.writeRaw("ticket", ticketRaw);
|
||||
}
|
||||
j.end();
|
||||
return j.str();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user