[][src]Struct env_logger::Env

pub struct Env<'a> { /* fields omitted */ }

Set of environment variables to configure from.

Default environment variables

By default, the Env will read the following environment variables:

  • RUST_LOG: the level filter
  • RUST_LOG_STYLE: whether or not to print styles with records.

These sources can be configured using the builder methods on Env.

Methods

impl<'a> Env<'a>[src]

pub fn new() -> Self[src]

Get a default set of environment variables.

pub fn filter<E>(self, filter_env: E) -> Self where
    E: Into<Cow<'a, str>>, 
[src]

Specify an environment variable to read the filter from.

pub fn filter_or<E, V>(self, filter_env: E, default: V) -> Self where
    E: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Specify an environment variable to read the filter from.

If the variable is not set, the default value will be used.

pub fn default_filter_or<V>(self, default: V) -> Self where
    V: Into<Cow<'a, str>>, 
[src]

Use the default environment variable to read the filter from.

If the variable is not set, the default value will be used.

pub fn write_style<E>(self, write_style_env: E) -> Self where
    E: Into<Cow<'a, str>>, 
[src]

Specify an environment variable to read the style from.

pub fn write_style_or<E, V>(self, write_style_env: E, default: V) -> Self where
    E: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Specify an environment variable to read the style from.

If the variable is not set, the default value will be used.

pub fn default_write_style_or<V>(self, default: V) -> Self where
    V: Into<Cow<'a, str>>, 
[src]

Use the default environment variable to read the style from.

If the variable is not set, the default value will be used.

Trait Implementations

impl<'a, T> From<T> for Env<'a> where
    T: Into<Cow<'a, str>>, 
[src]

impl<'a> Default for Env<'a>[src]

impl<'a> Debug for Env<'a>[src]

Auto Trait Implementations

impl<'a> Send for Env<'a>

impl<'a> Sync for Env<'a>

impl<'a> Unpin for Env<'a>

impl<'a> UnwindSafe for Env<'a>

impl<'a> RefUnwindSafe for Env<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]