Skip to content

flayer.diagnostics.reporting

Module source

flayer.diagnostics.reporting

Stable JSON and concise text representations of sanitized diagnostic reports.

RenderJson

RenderJson(report: DiagnosticReport) -> str

Serialize only the versioned public report with deterministic JSON keys.

Source code in installed/flayer/diagnostics/reporting.py
 8
 9
10
11
def RenderJson(report: DiagnosticReport) -> str:
    """Serialize only the versioned public report with deterministic JSON keys."""

    return json.dumps(report.AsDict(), sort_keys=True, allow_nan=False)

RenderText

RenderText(report: DiagnosticReport) -> str

Render one safe single-line observation per check without raw details.

Source code in installed/flayer/diagnostics/reporting.py
14
15
16
17
18
19
20
21
22
23
24
def RenderText(report: DiagnosticReport) -> str:
    """Render one safe single-line observation per check without raw details."""

    public = report.AsDict()
    lines = [f"{public['command']}: {public['status']}"]

    for check in report.checks:
        safe = check.AsDict()
        lines.append(f"[{safe['status']}] {safe['name']}: {safe['message']}")

    return "\n".join(" ".join(line.split()) for line in lines)