feat: add logfmt to kona node logging formats#3027
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds logfmt logging format support to the kona node logging infrastructure and updates the justfile to support loading Docker images into the local Docker instance.
Key changes:
- Added
Logfmtas a new logging format option alongside existing formats (full, json, pretty, compact) - Implemented custom
LogfmtFormatterto format tracing events in logfmt key=value format - Updated justfile to accept an optional
load_flagparameter for thebuild-localcommand
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docker/apps/justfile | Added optional load_flag parameter to build-local command to support loading Docker images with --load flag |
| crates/utilities/cli/src/tracing.rs | Implemented LogfmtFormatter struct and added Logfmt enum variant to LogFormat, integrated formatter into logging layers |
| crates/utilities/cli/src/flags/log.rs | Updated documentation comments to include logfmt in the list of available log formats |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| write!(writer, "level={} ", meta.level())?; | ||
|
|
||
| // Write target | ||
| write!(writer, "target={} ", meta.target())?; |
There was a problem hiding this comment.
The logfmt format implementation is inconsistent. According to the logfmt specification, all values should be quoted if they contain spaces or special characters. The level and target fields are not quoted, while time is quoted. For consistency and proper logfmt compliance, these should also be quoted.
Consider updating lines 61 and 64 to:
write!(writer, "level=\"{}\" ", meta.level())?;
write!(writer, "target=\"{}\" ", meta.target())?;| write!(writer, "level={} ", meta.level())?; | |
| // Write target | |
| write!(writer, "target={} ", meta.target())?; | |
| write!(writer, "level=\"{}\" ", meta.level())?; | |
| // Write target | |
| write!(writer, "target=\"{}\" ", meta.target())?; |
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. |
# Description * Adds logfmt to kona node available logging formats * Update just file to load docker image into local docker instance after docker buildx with load argument
# Description * Adds logfmt to kona node available logging formats * Update just file to load docker image into local docker instance after docker buildx with load argument
Description