Conversation
Signed-off-by: tison <wander4096@gmail.com>
This reverts commit b4487f6.
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR replaces the existing value-bag-based key/value representation with Logforth’s own structured key-value model (Key/Value + borrowed view types), aligning with the goal in #215 to define a first-class “structural logging” viewpoint and enabling more consistent formatting/serialization across layouts, appenders, and bridges.
Changes:
- Replaced
value-bagwith newlogforth_core::kvtypes (KeyView/ValueView,ValueOwned, map/list support) and updated allVisitorimplementations accordingly. - Updated the
logbridge to translatelog::kvinto Logforth’s KV model, with an optionalserdefeature path for richer typed capture. - Adjusted workspace/features (removed
value-bag, addedbridge-log-serde) and updated examples + CI to use the new feature wiring.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
logforth/Cargo.toml |
Adds bridge-log-serde feature wiring for the log bridge with serde support. |
layouts/text/src/lib.rs |
Updates KV visiting to use KeyView/ValueView. |
layouts/logfmt/src/lib.rs |
Updates KV visiting to use views; updates built-in KV emission to pass .view() values. |
layouts/json/src/lib.rs |
Updates KV collection to use view types for JSON serialization. |
layouts/google-cloud-logging/src/lib.rs |
Updates KV visiting to use KeyView/ValueView. |
examples/Cargo.toml |
Adds bridge-log-serde feature flag; adjusts example feature requirements and log dev-dep usage. |
diagnostics/task-local/src/lib.rs |
Updates diagnostic KV visiting to use borrowed/view KV types. |
diagnostics/fastrace/src/lib.rs |
Updates emitted KVs + tests for the new KV view/owned model. |
core/src/str.rs |
Adds Deref<Target=str> for RefStr to simplify string access/comparisons. |
core/src/record.rs |
Adjusts record cloning/default KV initialization to match the new KeyValues API. |
core/src/layout/plain_text.rs |
Updates plain-text layout KV visitor signature to view types. |
core/src/kv.rs |
Introduces the new in-house KV data model (Key/Value + view/owned + list/map), plus optional serde serialization. |
core/src/diagnostic/thread_local.rs |
Updates thread-local diagnostic KV visiting to the new API. |
core/src/diagnostic/static_global.rs |
Updates static-global diagnostic KV visiting to the new API. |
core/Cargo.toml |
Removes value-bag and redefines serde feature for core KV serialization. |
Cargo.toml |
Removes value-bag workspace dep; adjusts log workspace dependency feature configuration. |
bridges/log/src/lib.rs |
Refactors log bridge KV translation; adds serde-enabled conversion path. |
bridges/log/Cargo.toml |
Adds serde feature and adjusts log dependency features (kv, std, optional kv_serde). |
appenders/opentelemetry/src/lib.rs |
Updates KV extraction to map ValueView into OpenTelemetry AnyValue (including list/map). |
appenders/journald/src/lib.rs |
Updates journald KV visitor signature to view types. |
appenders/journald/src/field.rs |
Updates field encoding trait impls to accept ValueView. |
appenders/fastrace/src/lib.rs |
Updates KV collection/storage to use view types with fewer allocations where possible. |
appenders/async/src/worker.rs |
Renames diagnostic wrapper and updates visitor calls to .view() for owned keys/values. |
appenders/async/src/append.rs |
Updates diagnostic collection visitor signature to KeyView/ValueView. |
.github/workflows/ci.yml |
Updates CI example invocation to include bridge-log-serde where required. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
|
Should we fire a new release for this? |
|
@ariesdevil for sure. We'd need a core 0.4 and all subcrates. Also the facade to be 0.30. Actually, end users shall not touch these internals. But I'm working on #230 before we cut the next release or it would be a quick breaking. |
| pub struct KeyOwned(Cow<'static, str>); | ||
| impl fmt::Debug for DebugValue<'_> { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| fmt::Debug::fmt(&self.0, f) |
| }) | ||
| impl fmt::Display for DebugValue<'_> { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| fmt::Debug::fmt(&self.0, f) |
This closes #215