From 2fc747010b8746b876da245024cf6cd5b83fb59a Mon Sep 17 00:00:00 2001 From: Bradley Odell Date: Mon, 12 Feb 2024 19:07:55 -0800 Subject: [PATCH] Add `is_set` public function. --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c2d1fca..2bf866a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -99,6 +99,12 @@ impl Verbosity { } } + /// Whether any verbosity flags (either `--verbose` or `--quiet`) + /// have been specified on the command line. + pub fn is_set(&self) -> bool { + self.verbose != 0 || self.quiet != 0 + } + /// Get the log level. /// /// `None` means all output is disabled.