🛤️ Tracking: Plugin Logging #933
Labels
product: hc
Relates to the core "hc" binary
product: plugin
Relates to one or more hipcheck-maintained plugins
product: rust-sdk
Relates to the Rust plugin SDK
tracking-issue
This issue tracks a larger task.
type: enhancement
New feature or request
type: ui
UI-related changes that should get heightened review.
The goal is to provide some structure to plugin logging so that we can control it from the HC core. We will update plugin requirements to take a
--log-level=<DEBUG/INFO/ETC>
flag if they want to participate, and they will have to print out the logs in a JSON string format that we define, which includes the log level and parent/module. We then need to spawn a handler in HC core to listen for stderr, parse the JSON as it finds it, and forwards to the HC core logging subscriber. We first need to ensure this last part is possible, so it is the first subtask. Within HC core when we receive these messages, we can usetracing
again to force the parent module to beplugin::<PLUGIN_NAME>
so we can control whether the message gets printed withHC_LOG
.log
crate withtracing
crate and subscriber in plugins through SDKplugin
parent, formats logs in JSON, prints to stderr, document format requirements--log-level=
cmdline flag for plugins and docmentCommand::spawn
in main to handle stderr output from pluginsThe text was updated successfully, but these errors were encountered: