diff --git a/src/lib.rs b/src/lib.rs index ff18c6029..4e979c497 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1273,10 +1273,18 @@ pub trait Log: Sync + Send { /// This is used by the `log_enabled!` macro to allow callers to avoid /// expensive computation of log message arguments if the message would be /// discarded anyway. + /// + /// # For implementors + /// + /// This method isn't called automatically by the `log!` macros. + /// It's up to an implementation of the `Log` trait to call `enabled` in its own + /// `log` method implementation to guarantee that filtering is applied. fn enabled(&self, metadata: &Metadata) -> bool; /// Logs the `Record`. /// + /// # For implementors + /// /// Note that `enabled` is *not* necessarily called before this method. /// Implementations of `log` should perform all necessary filtering /// internally.