Skip to content

Commit

Permalink
chore: hint users to apply the logger (#56)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Aug 20, 2024
1 parent b6de6a3 commit 406b9d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ 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![] }
}
}

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
Expand Down

0 comments on commit 406b9d6

Please sign in to comment.