containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
184 stars 74 forks source link

Add support for structured logging #212

Closed jsturtevant closed 1 year ago

jsturtevant commented 1 year ago

This is a follow up to #210.

Example usage would be:

log::info!(target: "wasmtime", key1 = "test it"; "setting up wasi!!");

with the output

time="2023-10-06T21:49:05.767158934Z" level=info msg="calling start function"
time="2023-10-06T21:49:05.767242837Z" level=info key1="test it" msg="setting up wasi!!"
time="2023-10-06T21:49:05.767259938Z" level=info msg="waiting for instance: testwasm"

Question: Should this be behind a feature flag? The functionality is in log crate behind kv_unstable. The major issue would be that the api might change but it is pretty small api that is being used here and it is being used in projects like https://github.com/iorust/structured-logger