Skip to content
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

[QUERY] How to access Benthos log system from WASM? #2447

Open
webfrank opened this issue Mar 27, 2024 · 1 comment
Open

[QUERY] How to access Benthos log system from WASM? #2447

webfrank opened this issue Mar 27, 2024 · 1 comment

Comments

@webfrank
Copy link

Hi,
I've written a simple WASM module and I'm using it within benthos pipeline.
Now I would like to log some information, fmt.Print does not work. How can I access benthos logger?

@mihaitodor
Copy link
Member

Hey @webfrank 👋 I think that won't work because here the code would have to look something like r.InstantiateWithConfig(ctx, p.wasmBinary, wazero.NewModuleConfig().WithStdout(os.Stdout)) and there might be more changes required, dunno. Currently, Benthos just registers 4 functions which can be used to read / alter the message as it gets processed by the wasm module: v0_msg_set_bytes, v0_msg_as_bytes, v0_msg_set_meta, v0_msg_get_meta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants