Skip to content

chore: pre-release cleanup across syslog, core, layouts, appenders, and tests - #336

Merged
tisonkun merged 8 commits into
mainfrom
chore/pre-release-cleanup
Dec 3, 2026
Merged

tisonkun merged 8 commits into
mainfrom
chore/pre-release-cleanup

Conversation

@tisonkun

@tisonkun tisonkun commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove PosixSyslog::builder in logforth-append-syslog so all syslog and workspace builders consistently use *Builder::new() as their single construction entry point.
  • Wrap the logforth-append-async quick-start README snippet in a fallible main() instead of leaking a hidden # Ok::<(), ...>(()) rustdoc line into rendered Markdown.
  • Allow the remaining IANA-registered RFC 5424 bare SD-IDs ("snmp", "PCNNode", and "PCNTerm") in logforth_syslog::SdElement::new.
  • Back kv::MapValue and kv::MapValueIter with KeyValues and KeyValuesIter, and implement From<&Cow<'static, str>> for RefStr in logforth-core.
  • Reuse ValueView::to_i64 for signed and in-range unsigned integer conversion in logforth-append-opentelemetry.
  • Remove the unreachable diagnostic removal branch in GoogleCloudLoggingLayout::format and deduplicate empty-key and static-payload encoding in logforth-append-journald.
  • Materialize RecordOwned snapshots outside the events mutex in RecordingAppender::append, and consolidate duplicated FailingDiagnostic and render_layout helpers in tests-integration.

Test Plan

  • cargo x check
  • cargo x test
  • cargo x lint

…xSyslogBuilder::new

Align `PosixSyslog` with the rest of the workspace where multi-option builders are constructed directly via `*Builder::new()` rather than duplicate `Type::builder()` inherent methods.

Signed-off-by: tison <wander4096@gmail.com>
`README.md` is rendered directly as plain Markdown on GitHub and crates.io without rustdoc stripping `# ` prefixes. Wrap the fallible `.build()?` snippet in `fn main() -> Result<(), logforth_core::Error>` so the code block is valid copy-pasteable Rust.

Signed-off-by: tison <wander4096@gmail.com>
`SdElement::new` only accepted six bare RFC 5424 structured-data IDs (`timeQuality`, `origin`, `meta`, `alarm`, `ssign`, and `ssign-cert`), rejecting the remaining three IANA-registered bare SD-IDs (`snmp`, `PCNNode`, and `PCNTerm`) with `InvalidSdId`.

Add `snmp`, `PCNNode`, and `PCNTerm` to the registered bare ID list in `SdElement::new`.

Signed-off-by: tison <wander4096@gmail.com>
…'static, str>> for RefStr

Wrap `KeyValues` and `KeyValuesIter` inside `MapValue` and `MapValueIter` instead of duplicating borrowed/owned slice iteration and lookup logic, and deduplicate `'static`-preserving `Cow<'static, str>` projection through `From<&Cow<'static, str>> for RefStr`.
…ttributes

Collapse the four separate integer conversion match arms in `value_to_any_value` by delegating range checking to `ValueView::to_i64()`.

Signed-off-by: tison <wander4096@gmail.com>
…nch in route

`consumed` in the second diagnostic pass depends only on invariants computed in the first pass (`trace.is_some()`, `span_id.is_some()`, and `trace_sampled.is_some()`), so any key with `consumed == true` could never have been inserted into `labels` or `payload_fields` earlier in the pass. Simplify `route` to accept `ValueView` directly instead of `Option<ValueView>`.

Signed-off-by: tison <wander4096@gmail.com>
…payload encoding

`write_escaped_key` already emits `EMPTY` when given an empty key, and `std::fmt::Arguments::as_str` handles unformatted string payloads directly inside `PutAsFieldValue` without needing a separate `record.payload_static()` branch or `&str` impl.

Signed-off-by: tison <wander4096@gmail.com>
…fixtures

Materialize `RecordOwned` and `CapturedEvent` before locking `RecordingState::events` in `RecordingAppender::append`, and consolidate duplicated `FailingDiagnostic` and `render_layout` helpers into `tests-integration`.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
tisonkun merged commit 65216b7 into main Dec 3, 2026
10 checks passed
@tisonkun
tisonkun deleted the chore/pre-release-cleanup branch December 3, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant