quickjs-rs icon indicating copy to clipboard operation
quickjs-rs copied to clipboard

Add full logging example

Open vedantroy opened this issue 3 years ago • 2 comments

Using

 let ctx = Context::builder().console(quick_js::console::LogConsole).build()?;

and later I evaluate some code that uses console.log, the code will run but nothing will be printed.

vedantroy avatar Mar 23 '21 06:03 vedantroy

Hey.

The provided logger uses the log crate, which doesn't print anything by default.

You will have to enable a logging backend.

env-logger is a popular choice.

theduke avatar Mar 24 '21 09:03 theduke

We should probably add a full example that demonstrates logging.

theduke avatar Mar 25 '21 13:03 theduke