Logging

ZoKrates supports a command to log messages during execution in the interpreter.

The values of expressions can be checked and basic string interpolation is supported:

struct Foo {
    field[3] a;
    bool b;
}

def main(Foo x, field y) {
    log("x is {}, y is {}", x, y);
    return;
}

By default, logs get removed during compilation. In order to include them in the compiled program, the --debug flag has to be enabled.