Skip to main content

format_json_diagnostic_structured

Function format_json_diagnostic_structured 

Source
pub fn format_json_diagnostic_structured(
    level: &str,
    what: &str,
    why: Option<&str>,
    hint: Option<&str>,
) -> String
Expand description

Format a structured diagnostic as a JSON object for stderr.

Always emits all four fields {"level","what","why","hint"} so that consumers can rely on a fixed schema. Missing values are null.