[−][src]Struct spirit_log::CfgAndOpts
A combination of Cfg and Opts.
This is a composed Fragment ‒ the purpose is the caller can combine configuration both from
command line options and configuration inside the same Pipeline ‒ see the
crate examples.
The Fragment will then combine the options to create the relevant loggers.
Interaction on stderr
There's a little twist around stderr and the interaction between the -L option and loggers
set up in configuration. This is to act in a way that makes some sense ‒ in particular, we
don't want to log to stderr twice. Therefore:
- If the user specifies
-l(or-L) on the command line, any stderr logger from configuration is skipped (the-ltakes precedence). - If there are no loggers in configuration but there's no
-l, errors are logged to stderr. This is the case before configuration is loaded or if it contains no loggers. We want to report errors somewhere.
Fields
cfg: CfgThe configuration options.
opts: OptsThe command line options.
Trait Implementations
impl Clone for CfgAndOpts[src]
fn clone(&self) -> CfgAndOpts[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for CfgAndOpts[src]
impl Fragment for CfgAndOpts[src]
type Driver = TrivialDriver
The default driver to be used by the fragment. Read more
type Seed = ()
The intermediate product if the fragment supports two-stage creation of
Resources. If not, it can be set to (). Read more
type Resource = Dispatch
The actual product this Fragment creates.
type Installer = LogInstaller
The default installer to be used unless a transformation or the user doesn't provide one. Read more
const RUN_BEFORE_CONFIG: bool[src]
fn make_seed(&self, _name: &str) -> Result<(), AnyError>[src]
fn make_resource(&self, _: &mut (), _name: &str) -> Result<Dispatch, AnyError>[src]
fn create(
&self,
name: &'static str
) -> Result<Self::Resource, Box<dyn Error + 'static + Sync + Send>>[src]
&self,
name: &'static str
) -> Result<Self::Resource, Box<dyn Error + 'static + Sync + Send>>
fn init<B>(
builder: B,
&'static str
) -> Result<B, Box<dyn Error + 'static + Sync + Send>> where
B: Extensible<Ok = B>,
<B as Extensible>::Config: DeserializeOwned,
<B as Extensible>::Config: Send,
<B as Extensible>::Config: Sync,
<B as Extensible>::Config: 'static,
<B as Extensible>::Opts: StructOpt,
<B as Extensible>::Opts: Send,
<B as Extensible>::Opts: Sync,
<B as Extensible>::Opts: 'static, [src]
builder: B,
&'static str
) -> Result<B, Box<dyn Error + 'static + Sync + Send>> where
B: Extensible<Ok = B>,
<B as Extensible>::Config: DeserializeOwned,
<B as Extensible>::Config: Send,
<B as Extensible>::Config: Sync,
<B as Extensible>::Config: 'static,
<B as Extensible>::Opts: StructOpt,
<B as Extensible>::Opts: Send,
<B as Extensible>::Opts: Sync,
<B as Extensible>::Opts: 'static,
Auto Trait Implementations
impl RefUnwindSafe for CfgAndOpts
impl Send for CfgAndOpts
impl Sync for CfgAndOpts
impl Unpin for CfgAndOpts
impl UnwindSafe for CfgAndOpts
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> IntoResult<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,