Skip to content

Conversation

@peter-lawrey
Copy link
Member

@peter-lawrey peter-lawrey commented Oct 26, 2025

This PR brings Chronicle Logger up to the common OpenHFT standards for documentation, decision tracking, and test coverage. It also makes the ChronicleLogReader more robust when optional fields are absent or unknown, keeping CLI tools and programmatic processors in sync.

Highlights

  • Replace the skeletal requirements with a Nine-Box catalogue (traceable IDs + verification).
  • Add architecture overview and decision log for topology, config flow, and guardrails.
  • Expand unit tests around config load/reload and log read paths with self-contained queues.
  • Harden ChronicleLogReader to iterate optional fields deterministically (preserves throwable and args, skips unknowns).

Motivation

  • Previous requirements were a terse bullet list with no cross-links, acceptance criteria, or test traceability.
  • Sister projects already expose Nine-Box catalogues and decision logs; Logger lagged both in clarity and auditability.
  • Gaps in coverage left configuration reloads and reader behaviour under-verified, reducing confidence in documented promises.

Architectural & Documentation changes

  • adoc/architecture-overview.adoc

    • Describes module boundaries, configuration flow, and Chronicle Queue write path.
    • Cross-references requirement IDs so reviewers can map implementation to obligations.
  • adoc/decision-log.adoc

    • Records:

      • CLG-DOC-001 Adopt Nine-Box requirements catalogue.
      • CLG-OPS-002 Hard-fail on missing/unwritable queue paths.
      • CLG-NF-P-003 Zero-allocation budget for readers.
  • adoc/project-requirements.adoc

    • Rewritten as a requirements catalogue with Functional, Performance, Security/Operability, Test, and Docs/Ops sections.
    • Each entry has verification guidance; references added to overview and decision log.

Functional code & tests

Reader hardening

  • ChronicleLogReader

    • Uses wire.readEventName(..) to iterate remaining fields.
    • Skips unknown fields, decodes throwable and args if present.
    • Prevents prior IllegalArgumentException: primitive: void when optional sequences were missing.
    • Keeps CLI and programmatic decoding semantics aligned.

Tests

  • logger-tools/ChronicleLogReaderTest

    • Rewritten to use a self-contained writer + reader:

      • Builds a queue via DefaultChronicleLogWriter.
      • Asserts logger name, thread name, message pattern, and argument values across three entries.
      • Verifies reader output matches the documented schema.
  • logger-core/ChronicleLogManagerTest

    • Validates explicit property-file load and reload that switches queue paths:

      • Confirms messages land in the expected queues before/after reload.
      • Ensures no leakage or loss on writer recreation.
  • logger-core/ChronicleLogConfig & ChronicleLogWriter (Javadoc tweaks)

    • Clarify placeholder resolution is caller responsibility.
    • Clarify message parameter semantics (pattern vs formatted text).

@peter-lawrey peter-lawrey changed the title Expand requirements, documentation, and tests Elevate docs, add decision/architecture records, harden reader, and expand tests Oct 26, 2025
@peter-lawrey peter-lawrey marked this pull request as draft November 3, 2025 10:36
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.

2 participants