Skip to main content

pamoja_reporter_record

Function pamoja_reporter_record 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_reporter_record( reporter: *mut PamojaReporter, level: PamojaTelemetryLevel, ) -> bool
Expand description

Records an event and reports whether it is worth shipping.

Only the level crosses the boundary, because the level is the whole of what the reporter decides on. The code and the optional value stay with the caller, which is free to ship its own event when this returns true.

§Arguments

  • reporter - the reporter.
  • level - the severity of the event that occurred.

§Returns

true if the event passed the threshold and should be shipped, or false if it was counted and dropped, or reporter is null.

§Safety

reporter must be a live handle from pamoja_reporter_new, or null.