Struct spirit_log::Extras [−][src]
pub struct Extras<O, C> { /* fields omitted */ }
Description of extra configuration for logging.
This allows customizing the logging as managed by this crate, mostly by pairing it with command
line options (see Opts
) and adding arbitrary additional loggers.
The default does nothing (eg. no command line options and no extra loggers).
Methods
impl<O, C> Extras<O, C>
[src]
impl<O, C> Extras<O, C>
pub fn with_opts<F: Fn(&O) -> Opts + Send + Sync + 'static>(
extractor: F
) -> Self
[src]
pub fn with_opts<F: Fn(&O) -> Opts + Send + Sync + 'static>(
extractor: F
) -> Self
Constructs the Extras
structure with an extractor for options.
The passed closure should take the applications global options structure and return the
Opts
by which the logging from command line can be tweaked.
pub fn extra_loggers<F>(self, extra: F) -> Self where
F: Fn(&O, &C) -> Result<(LevelFilter, Vec<Box<Log>>), Error> + Send + Sync + 'static,
[src]
pub fn extra_loggers<F>(self, extra: F) -> Self where
F: Fn(&O, &C) -> Result<(LevelFilter, Vec<Box<Log>>), Error> + Send + Sync + 'static,
Modifies the Extras
to contain another source of additional loggers.
Each such closure is run every time logging is being configured. It can return either bunch of loggers (with the needed log level), or an error. If an error is returned, the loading of new configuration is aborted.
Trait Implementations
impl<O, C> Default for Extras<O, C>
[src]
impl<O, C> Default for Extras<O, C>
impl<O, C> CfgHelper<O, C, Extras<O, C>> for Cfg where
C: DeserializeOwned + Send + Sync + 'static,
O: Debug + StructOpt + Sync + Send + 'static,
[src]
impl<O, C> CfgHelper<O, C, Extras<O, C>> for Cfg where
C: DeserializeOwned + Send + Sync + 'static,
O: Debug + StructOpt + Sync + Send + 'static,