I'm working on a package that has functions that call other existing and packaged functions. I'd like a way to output what some of those key calls are, so users can see what's happening under the hood and for debugging purposes.
Here's a minimal example that wraps around NDSolve:
ex[eqns_, unks_, tmax_] := (
Print["NDSolve[", eqns, ", ", unks, ", {t, 0, ", tmax, "}]"]; (* output code *)
NDSolve[eqns, unks, {t, 0, tmax}]
)
ex[{n'[t] == n[t] (1 - n[t]), n[0] == 0.01}, {n}, 10]
NDSolve[{n'[t]==(1-n[t]) n[t],n[0]==0.01}, {n}, {t, 0, 10}]
{{n->InterpolatingFunction[...]}}
This approach basically works but has two issues I'd like to fix:
Issue 1: The output code is ugly and a minor hassle to write correctly.
Issue 2: If you copy and paste the output cell, it comes out as
"NDSolve["{n'[t]==(1-n[t]) n[t],n[0]==0.01`}", "{n}", {t, 0, "10"}]"
which isn't executable. I'd want to get:
NDSolve[{n'[t]==(1-n[t]) n[t],n[0]==0.01}, {n}, {t, 0, 10}]
Any ideas on how to address either (or hopefully both) of these issues?

ExpressionCell[ Defer[expr], "Input", CellDingbat -> ">"]will even be directly evaluatable. – Kuba Oct 30 '17 at 14:52GeneratedCell -> Truedid not help) 2. the output won't inherit the style (dingbat, colour) of the echo output if the input is re-evaluated – Szabolcs Oct 30 '17 at 14:57CellAutoOverwrite -> Trueshould do. About 2), didn't get it and have to go. Will check later. – Kuba Oct 30 '17 at 15:15CellAutoOverwrite -> Truedidn't seem to fix the issue Szabolcs raised, but not having direct evaluability isn't such a big deal. – Chris K Oct 30 '17 at 18:52