16 std::string message_as_str;
17 message_as_str = formatStr +
": [";
20 for (uint32_t i = 0; i < args.size(); ++i) {
22 if (i < args.size() - 1) {
23 message_as_str +=
", ";
26 message_as_str +=
"]";
28 return message_as_str;
52 const auto level_value = unconstrained_read(
level_offset);
53 const uint8_t level_number = level_value.as<uint8_t>();
57 const uint32_t fields_size = fields_size_value.as<uint32_t>();
59 const uint32_t memory_reads =
64 throw std::runtime_error(
70 std::string message_as_str;
73 message_as_str +=
static_cast<char>(
static_cast<uint8_t
>(message_field.as_ff()));
75 std::vector<FF> fields;
76 fields.reserve(fields_size);
79 for (uint32_t i = 0; i < fields_size; ++i) {
81 fields.push_back(
field.as_ff());
85 throw std::runtime_error(
"Invalid debug log level: " +
std::to_string(level_number));
std::vector< DebugLog > debug_logs
uint32_t total_memory_reads
static std::string applyStringFormatting(const std::string &formatStr, const std::span< FF > &args)
bool isLevelEnabled(DebugLogLevel level) const
uint32_t max_memory_reads
void debug_log(MemoryInterface &memory, AztecAddress contract_address, MemoryAddress level_offset, MemoryAddress message_offset, uint16_t message_size, MemoryAddress fields_offset, MemoryAddress fields_size_offset) override
const MemoryValue & unconstrained_get(MemoryAddress index) const
AztecAddress contract_address
bool is_valid_debug_log_level(uint8_t v)
std::string field_to_string(const FF &ff)
std::string debug_log_level_to_string(DebugLogLevel lvl)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::string to_string(bb::avm2::ValueTag tag)
General class for prime fields see Prime field documentation["field documentation"] for general imple...