At the moment you’d have to do this by hand by using the key value pairs if you want to capture the values which go into the message:
@info "Starting iteration $i" i
The philosophy here is that the message is for human consumption, while the key value pairs are for holding structured data without needing to convert it to text. In general I think you want two different things for those.
I did consider destructuring the expression and storing the values which went into it, but I’m not sure it’s easy or sensible to do this in general because it can sometimes be useful for the expression to contain logic in addition to being a simple template. An example from Base.Pkg:
"Package $p was set to version $v, but a higher version $(vers[end]) exists.\n" *
"The package is fixed. You can try using `Pkg.free(\"$p\")` to update it."
"The update is prevented by explicit requirements constraints. Edit your REQUIRE file to change this."
string("To install the latest version, you could try updating these packages as well: ", join(blocking_parents, ", ", " and "), ".")
"To install the latest version, you could try doing a full update with `Pkg.update()`."