Skip to content

feat(runtime): add log level set/get for pdk control#758

Merged
nilslice merged 2 commits intomainfrom
log-level-state
Aug 28, 2024
Merged

feat(runtime): add log level set/get for pdk control#758
nilslice merged 2 commits intomainfrom
log-level-state

Conversation

@nilslice
Copy link
Copy Markdown
Member

@nilslice nilslice commented Aug 27, 2024

In addition to this change, @zshipko is looking into if we need to extract basic log level info from the more complex filter string, and how to require tracing compatibility to at least set some level (or to work when there is no level set thus ignoring all logs)

For other runtimes, there is still an equivalent implementation for get_log_level() -> I32 in Go and JS, as well as the ability to set the log level for the host, which is then loaded when get_log_level is called.

TODO:

@nilslice
Copy link
Copy Markdown
Member Author

@zshipko thank you for the follow up commit. I am doing a quick spike on the Go SDK implementation to see if there is any complexity as far as consistency to this impl goes.

Will update here and we can merge this after that.

@nilslice
Copy link
Copy Markdown
Member Author

Ok, there's a tiny bit of complexity 😆, but no more than to be expected... LGTM!

@nilslice nilslice merged commit b6e1caa into main Aug 28, 2024
@nilslice nilslice deleted the log-level-state branch August 28, 2024 20:31
nilslice added a commit to extism/go-sdk that referenced this pull request Sep 16, 2024
#74)

This PR aligns the extism host env with Rust, as per
extism/extism#758

NOTE of breaking change:

I've removed the ability to set the log level on the `*Plugin` itself.
To align with Rust SDK, this is only an SDK-global setting. You can
still add a custom logger to each plugin function. The SDK won't print
any logs unless there is a log function set for each plugin. The global
setting is in line with how libraries are expected to respect the main
application's log level.
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.

2 participants