pub struct Reporter { /* private fields */ }Expand description
Fans run events out to every enabled sink.
Implementations§
Source§impl Reporter
impl Reporter
Sourcepub fn new(
level: Level,
color: ColorMode,
log_file: Option<&Path>,
junit_file: Option<&Path>,
trace_file: Option<&Path>,
github_annotations: bool,
) -> Result<Self>
pub fn new( level: Level, color: ColorMode, log_file: Option<&Path>, junit_file: Option<&Path>, trace_file: Option<&Path>, github_annotations: bool, ) -> Result<Self>
Creates a reporter with the given console settings and optional output files. Fails if a log/JUnit/trace file cannot be opened.
§Errors
Returns an io error when any configured output file cannot be created.
Sourcepub fn emit(&self, event: &TestEvent) -> Result<()>
pub fn emit(&self, event: &TestEvent) -> Result<()>
Emits one event to every enabled sink. The event is cloned and redacted (configured + runtime-observed secrets) before any sink sees it.
§Errors
Returns an io error when writing the NDJSON log file fails.
Sourcepub fn add_redaction_secret(&self, value: &str)
pub fn add_redaction_secret(&self, value: &str)
Registers a literal value redacted from every report sink. Explicit extras always apply, regardless of length. Append-only: config- derived secrets registered later coexist with these.
Sourcepub fn add_redaction_secrets(&self, values: impl IntoIterator<Item = String>)
pub fn add_redaction_secrets(&self, values: impl IntoIterator<Item = String>)
Registers config-derived secrets (with the default minimum length) redacted from every report sink.
Sourcepub fn info(&self, msg: impl AsRef<str>)
pub fn info(&self, msg: impl AsRef<str>)
Writes a plain informational line if the current level allows it.