Closed atjn closed 1 year ago
Hi @atjn,
It looks like a bug in Emscripten's NODERAWFS
filesystem backend, on the web this works properly:
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 VIPS_WARNING
environment variable, as shown in the example above.
Upstream issue: https://github.com/emscripten-core/emscripten/issues/17688
Thank you so much for the absolutely excellent debug work here!
Upstream PR: https://github.com/emscripten-core/emscripten/pull/18163.
I just cherry-picked that PR in the https://github.com/emscripten-core/emscripten/compare/3.1.29...kleisauke:wasm-vips-3.1.29 changeset with commit https://github.com/kleisauke/emscripten/commit/cf6cdde22382590929698e570f26afce0d0c0a1f.
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: