4.2 Print
Last updated
log = (...args) => {
this.#printFunc(
inspectArgs(args, {
...getConsoleInspectOptions(),
indentLevel: this.indentLevel,
}) + "\n",
1,
);
};print: (msg, isErr) => ops.op_print(msg, isErr),pub fn op_print(#[string] msg: &str, is_err: bool) -> Result<(), Error> {
if is_err {
stderr().write_all(msg.as_bytes())?;
stderr().flush().unwrap();
} else {
stdout().write_all(msg.as_bytes())?;
stdout().flush().unwrap();
}
Ok(())
}