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 is_silent(&self) -> bool
pub fn is_silent(&self) -> bool
If the user requested complete silence (i.e. not just no-logging).
Sourcepub fn filter(&self) -> VerbosityFilter
pub fn filter(&self) -> VerbosityFilter
Gets the filter that should be applied to the logger.
Source§impl<L: LogLevel> Verbosity<L>
impl<L: LogLevel> Verbosity<L>
Sourcepub fn log_level(&self) -> Option<Level>
Available on crate feature log
only.
pub fn log_level(&self) -> Option<Level>
log
only.Get the log level.
None
means all output is disabled.
Sourcepub fn log_level_filter(&self) -> LevelFilter
Available on crate feature log
only.
pub fn log_level_filter(&self) -> LevelFilter
log
only.Get the log level filter.
Source§impl<L: LogLevel> Verbosity<L>
impl<L: LogLevel> Verbosity<L>
Sourcepub fn tracing_level(&self) -> Option<Level>
Available on crate feature tracing
only.
pub fn tracing_level(&self) -> Option<Level>
tracing
only.Get the tracing level.
None
means all output is disabled.
Sourcepub fn tracing_level_filter(&self) -> LevelFilter
Available on crate feature tracing
only.
pub fn tracing_level_filter(&self) -> LevelFilter
tracing
only.Get the tracing 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