Struct spirit_log::CfgAndOpts[][src]

pub struct CfgAndOpts {
    pub cfg: Cfg,
    pub opts: Opts,
}
Expand description

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 -l takes 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: Cfg

The configuration options.

opts: Opts

The command line options.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The default driver to be used by the fragment. Read more

The intermediate product if the fragment supports two-stage creation of Resources. If not, it can be set to (). Read more

The actual product this Fragment creates.

The default installer to be used unless a transformation or the user doesn’t provide one. Read more

Configuration if the pipeline should be run once even before the config is loaded. Read more

Runs the first stage of creation. Read more

Runs the second stage of creation. Read more

Runs both stages of creation at once. Read more

An initialization routine. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Turns self into the result.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.