refactor!: use tracing crate for logging, add extism_log_callback function#578
refactor!: use tracing crate for logging, add extism_log_callback function#578
tracing crate for logging, add extism_log_callback function#578Conversation
tracing crate for loggingtracing crate for logging
|
@mhmd-azeez I just pushed a commit to add |
tracing crate for loggingtracing crate for logging, add extism_log_callback function
Just saw this comment. I took a quick look and it looks good, but I will take a deeper look and try to implement it tomorrow. will keep you updated |
|
I'm running into an issue with Python where tracing-subscriber continues to call the logging function even after the Python runtime has cleaned up and realized that the log function can be called because of logging that happens in a Rust background thread, which makes it pretty tricky to handle correctly. I am going to try to change the design to make it so the logs are buffered and the SDK calls a function like |
|
Alright, just pushed a change to use |
|
@mhmd-azeez merging this now, but happy to make any adjustments if you end up running into any issues. |
Support for extism/extism#578 Update to `extism_sys==^1.0.0-rc7` --------- Co-authored-by: Chris Dickinson <[email protected]>
tracinginstead oflogcratetracing-subscriberinstead offernlogevents usingtracing-subscriberextism::set_log_fileprivate and only used through the C API, Rust users should usetracing-subscriberto determine which filters/levels to log.extism::set_log_callbackfunction to set a callback that can be used for custom logging from Rust.bool extism_log_custom(const char *level)andextism_log_drain(void (*fn)(const char *s, size_t length)to the C API to enable custom sinks in other SDKs