pub struct Verbosity<L: LogLevel = ErrorLevel> { /* private fields */ }
Expand description
Logging flags to #[command(flatten)]
into your CLI
Implementations§
Source§impl<L: LogLevel> Verbosity<L>
impl<L: LogLevel> Verbosity<L>
Sourcepub fn new(verbose: u8, quiet: u8) -> Self
pub fn new(verbose: u8, quiet: u8) -> Self
Create a new verbosity instance by explicitly setting the values
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Whether any verbosity flags (either --verbose
or --quiet
)
are present on the command line.
Sourcepub fn log_level_filter(&self) -> LevelFilter
pub fn log_level_filter(&self) -> LevelFilter
Get the log level filter.
Trait Implementations§
Source§impl<L: LogLevel> Args for Verbosity<L>
impl<L: LogLevel> Args for Verbosity<L>
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command
so it can instantiate self
via
FromArgMatches::update_from_arg_matches_mut
Read moreSource§impl<L: LogLevel> FromArgMatches for Verbosity<L>
impl<L: LogLevel> FromArgMatches for Verbosity<L>
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Auto Trait Implementations§
impl<L> Freeze for Verbosity<L>
impl<L> RefUnwindSafe for Verbosity<L>where
L: RefUnwindSafe,
impl<L> Send for Verbosity<L>where
L: Send,
impl<L> Sync for Verbosity<L>where
L: Sync,
impl<L> Unpin for Verbosity<L>where
L: Unpin,
impl<L> UnwindSafe for Verbosity<L>where
L: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more