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

Down-level logging in the WasiPreview1 #563

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Conversation

andreaTP
Copy link
Collaborator

@andreaTP andreaTP commented Oct 4, 2024

Fix #534

Copy link
Collaborator

@electrum electrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow up, we could generate these automatically in the annotation processor

I’d like to have output like strace where it prints the call and result all on one line. That would be ugly to do in the code, but easy with a generated wrapper. It needs try/catch so that we can log the call without the result when an exception is thrown.

For the result, we’d like the log to print the enum, so we’d need a way to declare the conversion from enum to WASI result type.

And even better, we could have exception mapping support, similar to JAX-RS, so that we could throw exceptions from WASI. That would allow some cleanup of the code, which is difficult now with direct return of errors. But this might be over-engineering.

@andreaTP
Copy link
Collaborator Author

andreaTP commented Oct 6, 2024

@electrum agreed, let me work a little more on the annotation processors before proposing this change if you don't mind 🙏

@andreaTP andreaTP merged commit 1d8eea5 into dylibso:main Oct 6, 2024
13 checks passed
@electrum
Copy link
Collaborator

electrum commented Oct 6, 2024

Sure, I'm in no hurry to work on this, currently focused on AOT.

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

Successfully merging this pull request may close these issues.

Down-level logging in the WasiPreview1 module
2 participants