From 1c631193d26889e8b6e135247c36286980256679 Mon Sep 17 00:00:00 2001 From: tison Date: Tue, 20 Aug 2024 14:13:58 +0800 Subject: [PATCH] chore: hint users to apply the logger Signed-off-by: tison --- src/logger.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/logger.rs b/src/logger.rs index cc29849..f219d6e 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -144,6 +144,7 @@ impl Default for Logger { impl Logger { /// Create a new [`Logger`] instance. + #[must_use = "call `dispatch` to add a dispatch to the logger and `apply` to set the global logger"] pub fn new() -> Logger { Self { dispatches: vec![] } } @@ -151,6 +152,7 @@ impl Logger { impl Logger { /// Add a [`Dispatch`] to the [`Logger`]. + #[must_use = "call `apply` to set the global logger"] pub fn dispatch(mut self, dispatch: Dispatch) -> Logger { self.dispatches.push(dispatch); self