neon-bindings / neon

Rust bindings for writing safe and fast native Node.js modules.
https://www.neon-bindings.com/
Apache License 2.0
8k stars 283 forks source link

Question: Logging #990

Closed Will-Smith11 closed 1 year ago

Will-Smith11 commented 1 year ago

Currently trying to setup logging in rust and no matter what i try. println!(), logging, std::io::Stdout.. etc theres no output. I looked through the docs and didn't see anything about logging there so im wondering what the fix here. Is there something exposed under cx to log?

kjvalencik commented 1 year ago

Can you tell me about your setup (e.g. OS, version)? Neon doesn't do anything to capture output. println and typical rust logging facilities should work as expected.

How are you rebuilding? Is it possible the new version isn't being copied?

Will-Smith11 commented 1 year ago

Can you tell me about your setup (e.g. OS, version)? Neon doesn't do anything to capture output. println and typical rust logging facilities should work as expected.

How are you rebuilding? Is it possible the new version isn't being copied?

Rebuilding

cd neon-dir
npm install

cd ..
npm install (neon dir is as a path directory)
npm run build
../path-to-entrypoint

in terms of Os: im on Manjaro (arch) and neon verison 0.10

Will-Smith11 commented 1 year ago

hmm seems to be working when i just delete the index.node before rebuilding

kjvalencik commented 1 year ago

Interesting. That sounds the the mtime heuristic in cargo-cp-artifact is failing.

https://github.com/neon-bindings/neon/blob/main/pkgs/cargo-cp-artifact/src/index.js#L103-L112