Replies: 1 comment 4 replies
-
I think the easiest and most performant option would be a small extension: This is a small extension that provides a javascript-binding for #[op2(fast)]
fn op_trace(#[string] name: &str, #[string] msg: &str) {
tracing::info!(name: name, msg);
}
extension!(
impl_trace,
ops = [op_trace],
esm_entry_point = "ext:impl_trace/trace.js",
esm = [ dir "impl_trace", "trace.js" ],
); And _log = globalThis.console.log;
globalThis.console.log = (msg) => {
Deno.core.ops.op_trace("console.log", msg);
_log(msg);
}; |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to pipe
console.log
output intotracing::info
?Beta Was this translation helpful? Give feedback.
All reactions