pub struct LoggingArgs {
pub show_source: bool,
pub json: bool,
pub console: ConsoleMode,
/* private fields */
}
Expand description
Provides helpful logging args for clap clis
Fields§
§show_source: bool
Show the source of a logging statement when running in any non complicated mode
json: bool
Outputs everything as json
console: ConsoleMode
The console output mode.
Implementations§
Source§impl LoggingArgs
impl LoggingArgs
Sourcepub fn log_level_filter(&self) -> LevelFilter
pub fn log_level_filter(&self) -> LevelFilter
Gets the log level
pub fn init_root_logger(&self) -> Result<Option<JoinHandle<()>>, SetLoggerError>
pub fn init_root_logger_with(filter: LevelFilter, mode: OutputType)
pub fn try_init_root_logger_with( filter: LevelFilter, mode: OutputType, ) -> Result<(), SetLoggerError>
pub fn create_logger(&self) -> (Dispatch, Option<JoinHandle<()>>)
pub fn create_logger_with( filter: LevelFilter, mode: OutputType, show_source: bool, output: impl Into<Option<Output>>, ) -> Dispatch
Trait Implementations§
Source§impl Args for LoggingArgs
impl Args for LoggingArgs
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 Clone for LoggingArgs
impl Clone for LoggingArgs
Source§fn clone(&self) -> LoggingArgs
fn clone(&self) -> LoggingArgs
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LoggingArgs
impl Debug for LoggingArgs
Source§impl Default for LoggingArgs
impl Default for LoggingArgs
Source§fn default() -> LoggingArgs
fn default() -> LoggingArgs
Returns the “default value” for a type. Read more
Source§impl FromArgMatches for LoggingArgs
impl FromArgMatches for LoggingArgs
Source§fn from_arg_matches(
__clap_arg_matches: &ArgMatches,
) -> Result<LoggingArgs, Error>
fn from_arg_matches( __clap_arg_matches: &ArgMatches, ) -> Result<LoggingArgs, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<LoggingArgs, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<LoggingArgs, 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
.Source§impl Merge for LoggingArgs
impl Merge for LoggingArgs
Source§fn merge(&mut self, other: LoggingArgs)
fn merge(&mut self, other: LoggingArgs)
Merge another object into this object.
Auto Trait Implementations§
impl Freeze for LoggingArgs
impl RefUnwindSafe for LoggingArgs
impl Send for LoggingArgs
impl Sync for LoggingArgs
impl Unpin for LoggingArgs
impl UnwindSafe for LoggingArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InstanceOf for T
impl<T> InstanceOf for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more