-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Labels
Description
Implementing my own on_debug
for the engine is broken due to incorrect handling of the message as a debug string, not the string given to the debug call
To Reproduce:
- Implement your own
debug
function (only the text value given is relevant for this issue):
engine.on_debug(move |text, _, _| {
println!("DEBUG: {}", text);
});
- Call
debug
from Rhai
debug("test");
- Observe that the printed line is NOT the given string, but instead its
std::fmt::Debug
implementation, despite the print within our debug function specifyingstd::fmt::Display
. We get:
DEBUG: "test"
when we should in fact get:
DEBUG: test
Can debug be changed so that it's given the actual string passed to it, as print
is?