Skip to main content

send_event

Function send_event 

Source
pub fn send_event<T: Serialize + ?Sized>(name: &str, details: &T)
Expand description

Indicates to Antithesis that a certain event has been reached. It sends a structured log message to Antithesis that you may later use to aid debugging.

In addition to details, you also provide name, which is the name of the event that you are logging.

Details may be any borrowed value implementing Serialize. Objects are preserved; other non-null JSON values are wrapped under "value", for example 3 becomes {"value": 3}. Null and serialization errors produce an empty event body {}. Serialization errors also emit an antithesis_error message. With the full feature disabled, details are not serialized.

ยงExample

use serde_json::{json, Value};
use antithesis_sdk::lifecycle;

let info_value: Value = json!({
    "month": "July",
    "day": 17
});

lifecycle::send_event("start_day", &info_value);