How to redirect cconsole.log's output to a file
I want to run the js code with rust and get the data from consloe.log()
Most of the code is the same as in the runtime/examples https://github.com/denoland/deno/tree/main/runtime/examples
A little bit different
let file=File::open("log.txt").await?;
let stdio=Stdio {
stdin: StdioPipe::Inherit,
stdout: StdioPipe::File(file),
stderr: StdioPipe::Inherit,
}
let options = WorkerOptions {
//...
stdio: stdio,
};
I noticed that the code has
let permissions = PermissionsContainer::allow_all();
Granted read access to the file
The error message looks like this
Error: PermissionDenied: Access Denied。 (os error 5)
at Object.print (internal:core/01_core.js:394:32)
at Console.<anonymous> (internal:deno_runtime-0.97.0/js/98_global_scope.js:126:40)
at console.log (internal:ext/console/02_console.js:1984:22)
at file:///D:/deno_run/examples/hello_runtime.js:1:9
error: process didn't exit successfully: `target\debug\deno_run.exe` (exit code: 1)
Anyone tell me what's going on, thanks guys

