@@ -827,6 +827,30 @@ where
827
827
// seems like a good future-proofing measure as it may grow other methods later...
828
828
fn on_follows_from ( & self , _span : & span:: Id , _follows : & span:: Id , _ctx : Context < ' _ , C > ) { }
829
829
830
+ /// Called before `on_event`, to determine if `on_event` should be called.
831
+ ///
832
+ /// <div class="example-wrap" style="display:inline-block">
833
+ /// <pre class="ignore" style="white-space:normal;font:inherit;">
834
+ ///
835
+ /// **Note**: This method determines whether an event is globally enabled,
836
+ /// *not* whether the individual subscriber will be notified about the
837
+ /// event. This is intended to be used by layers that implement filtering
838
+ /// for the entire stack. Layers which do not wish to be notified about
839
+ /// certain events but do not wish to globally disable them should ignore
840
+ /// those events in their [on_event][Self::on_event].
841
+ ///
842
+ /// </pre></div>
843
+ ///
844
+ /// See [the trait-level documentation] for more information on filtering
845
+ /// with `Subscriber`s.
846
+ ///
847
+ /// [`Interest`]: tracing_core::Interest
848
+ /// [the trait-level documentation]: #filtering-with-subscribers
849
+ #[ inline] // collapse this to a constant please mrs optimizer
850
+ fn event_enabled ( & self , _event : & Event < ' _ > , _ctx : Context < ' _ , C > ) -> bool {
851
+ true
852
+ }
853
+
830
854
/// Notifies this subscriber that an event has occurred.
831
855
fn on_event ( & self , _event : & Event < ' _ > , _ctx : Context < ' _ , C > ) { }
832
856
0 commit comments