Function inject_logger

Source
pub fn inject_logger(new_logger: &'static dyn Log)
Expand description

Injects a logger as the global logger backend.

This method allows upper-level users to inject their own implemented loggers, but only allows injecting once. Subsequent injection will have no effect.

Caution: The implementation of log operation in the injected logger should ideally be heap-free and not involve sleep operations. Otherwise, users should refrain from calling log in sensitive locations, such as during heap allocations, as this may cause the system to block.