MCPcopy Create free account
hub / github.com/Snapchat/Valdi / sendLog

Method sendLog

valdi/src/valdi/runtime/Debugger/DaemonClient.cpp:61–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void DaemonClient::sendLog(LogType logType, const std::string& message) {
62 Value log;
63 switch (logType) {
64 case LogTypeDebug:
65 log.setMapValue("severity", Value(STRING_LITERAL("debug")));
66 break;
67 case LogTypeInfo:
68 log.setMapValue("severity", Value(STRING_LITERAL("info")));
69 break;
70 case LogTypeWarn:
71 log.setMapValue("severity", Value(STRING_LITERAL("warn")));
72 break;
73 case LogTypeError:
74 log.setMapValue("severity", Value(STRING_LITERAL("error")));
75 break;
76 case LogTypeCount:
77 break;
78 }
79 log.setMapValue("log", Value(message));
80 auto logs = ValueArray::make(1);
81 logs->emplace(0, log);
82 Value newLogs;
83 newLogs.setMapValue("new_logs", Value(logs));
84 Value json;
85 json.setMapValue("event", newLogs);
86 submitPayload(json);
87}
88
89void DaemonClient::submitRequest(const Value& payload, const Ref<ValueFunction>& callback) {
90 submitRequest(payload, [=](const Value& response) {

Callers 2

TESTFunction · 0.80
willLogMethod · 0.80

Calls 2

ValueClass · 0.50
emplaceMethod · 0.45

Tested by 1

TESTFunction · 0.64