From 406b9d6d7bcdc1dbb3d291fd7ea70aa64457a3d2 Mon Sep 17 00:00:00 2001 From: tison Date: Tue, 20 Aug 2024 16:24:01 +0800 Subject: [PATCH] chore: hint users to apply the logger (#56) 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