-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom stdout
and stderr
#23
Comments
Hi @atjn, It looks like a bug in Emscripten's import Vips from 'wasm-vips';
const log = (type, text) => console.log(`${type}: ${text}`);
const vips = await Vips({
print: (text) => log('stdout', text),
printErr: (text) => log('stderr', text),
preRun: (module) => {
// Handy for debugging
// module.ENV.VIPS_INFO = '1';
// module.ENV.VIPS_LEAK = '1';
// Hide warning messages
module.ENV.VIPS_WARNING = '0';
}
}); For now, I can recommend setting the Upstream issue: emscripten-core/emscripten#17688 |
Thank you so much for the absolutely excellent debug work here! |
Upstream PR: emscripten-core/emscripten#18163. |
I just cherry-picked that PR in the emscripten-core/emscripten@3.1.29...kleisauke:wasm-vips-3.1.29 changeset with commit kleisauke/emscripten@cf6cdde. This will be in v0.0.5. |
v0.0.5 now available. |
I am using
wasm-vips
as a dependency for a CLI tool. Currently, ifvips
encounters a warning, it will output it directly to the console. This is pretty annoying because the CLI tool already is outputting information to the console, so now there are random fragments ofvips
warnings cluttered in with the rest of the information.I would like to be able to receive the warnings in a function, where I can write my own logic for when and where the output should be logged.
If that is not possible, the next best thing would be to tell
wasm-vips
to never output anything.Maybe this is already supported? But I can't seem to figure out how it works. I have already tried this, as an attempt to make it stop outputting to the CLI, but it did not work:
The text was updated successfully, but these errors were encountered: