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

Method dumpLogs

valdi/src/valdi/runtime/Runtime.cpp:414–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412
413 logs.appendMetadata(STRING_LITERAL("ComponentPaths"), Value(builder.build()).toStringBox());
414
415 return logs;
416}
417
418DumpedLogs Runtime::dumpLogs(bool includeMetadata, bool includeVerbose, bool isCrashing) const {
419 std::future<Result<DumpedLogs>> jsDump;
420 if (_javaScriptRuntime != nullptr && !isCrashing) {
421 jsDump = _javaScriptRuntime->dumpLogs(includeMetadata, includeVerbose);
422 }
423
424 DumpedLogs logs;
425
426 if (includeMetadata) {
427 logs = dumpContextsLogs();
428 }
429
430 if (jsDump.valid()) {
431 auto status = jsDump.wait_for(std::chrono::seconds(2));
432
433 if (status == std::future_status::ready) {
434 auto result = jsDump.get();
435 if (result) {
436 logs.append(result.moveValue());
437 } else {
438 logs.appendVerbose(STRING_LITERAL("JS logs"),
439 Value(STRING_FORMAT("<Dumping data failed: {}>", result.error())));
440 }
441 } else {
442 logs.appendVerbose(STRING_LITERAL("JS logs"), Value(STRING_LITERAL("<Dumping data timed out>")));
443 }
444 }
445
446 return logs;

Callers 1

TEST_PMethod · 0.45

Calls 5

appendVerboseMethod · 0.80
getMethod · 0.65
appendMethod · 0.65
errorMethod · 0.65
ValueClass · 0.50

Tested by 1

TEST_PMethod · 0.36