better WASM logging to match rippled (#5395)

* basic logging

* pass in Journal

* log level based on journal level

* clean up

* attempt at adding WAMR logging properly

* improve logline

* maybe_unused

* fix

* fix

* fix segfault

* add test
This commit is contained in:
Mayukha Vadari
2025-05-23 10:31:02 -04:00
committed by GitHub
parent 5b43ec7f73
commit aef32ead2c
7 changed files with 213 additions and 69 deletions

View File

@@ -56,7 +56,7 @@ runEscrowWasm(
WASM_IMPORT_FUNC(imports, print, hfs)
std::int64_t const sgas = gasLimit; // vm.getGas();
auto ret = vm.run(wasmCode, funcName, imports);
auto ret = vm.run(wasmCode, funcName, imports, {}, hfs->getJournal());
// std::cout << "runEscrowWasm, mod size: " << wasmCode.size()
// << ", gasLimit: " << gasLimit << ", funcName: " << funcName;
@@ -92,9 +92,10 @@ WasmEngine::run(
wbytes const& wasmCode,
std::string_view funcName,
std::vector<WasmImportFunc> const& imports,
std::vector<WasmParam> const& params)
std::vector<WasmParam> const& params,
beast::Journal j)
{
return impl->run(wasmCode, funcName, imports, params);
return impl->run(wasmCode, funcName, imports, params, j);
}
std::int64_t