pub struct LogArgs {
pub log: Vec<Option<LogDestinationConfig>>,
}
Fields§
§log: Vec<Option<LogDestinationConfig>>
Log definition consisting of an optional log level filter, and a log destination. You can define this argument multiple times for multiple log destinations.
Logging can be disabled with --log none
.
If combined with other log definitions, those will take precedence and logging will not be disabled.
The argument can be combined with a level filter to only log messages of a certain level or higher to that destination.
Format: destination | level_filter:destination
- level_filter = “ERROR” | “WARN” | “INFO” | “DEBUG” | “TRACE”
- destination = “stderr” | “syslog” | “file:path” | “none”
Examples:
--log syslog
--log stderr
--log file:/path/to/file
--log INFO:stderr
--log DEBUG:file:/path/to/file
--log TRACE:syslog
--log none
Implementations§
Source§impl LogArgs
impl LogArgs
Sourcepub fn or_default(&self, default: LoggingConfig) -> LoggingConfig
pub fn or_default(&self, default: LoggingConfig) -> LoggingConfig
Build the LoggingConfig defined by the command line arguments from LogArgs.
If no --log
argument is given, the default config is returned.
Trait Implementations§
Source§impl Args for LogArgs
impl Args for LogArgs
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 CommandFactory for LogArgs
impl CommandFactory for LogArgs
Source§impl FromArgMatches for LogArgs
impl FromArgMatches for LogArgs
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
.Source§impl Parser for LogArgs
impl Parser for LogArgs
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for LogArgs
impl RefUnwindSafe for LogArgs
impl Send for LogArgs
impl Sync for LogArgs
impl Unpin for LogArgs
impl UnwindSafe for LogArgs
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