pub trait FailureMode {
    type ID: Hash + Eq;

    fn log_level(&self) -> LogLevel;
    fn identify(&self) -> Self::ID;
    fn display(&self) -> Option<String>;

    fn cooldown(&self) -> Duration { ... }
    fn log(&self) { ... }
}
Expand description

Something that can be logged in a sysfail handler

Required Associated Types§

Used to de-duplicate identical messages to avoid spamming the log.

Required Methods§

The log level of specific values.

What constitutes “distinct” error types.

What to log, the default FailureMode::log impl does nothing if None.

Provided Methods§

How long an error must not be produced in order to be displayed again.

This controls when FailureMode::log is called.

Return Duration::ZERO to trigger FailureMode::log each time there is an error.

What happens, by default this logs based on the return value of FailureMode::log_level.

Examples

https://crates.io/crates/bevy_debug_text_overlay provides a wrapper struct to replace log-printing with displaying errors on screen.

Implementations on Foreign Types§

By default, only print a single error per system.

By default, only print a single error per system.

Implementors§