[][src]Struct yall::Logger

pub struct Logger { /* fields omitted */ }

The main struct of this crate which implements the Log trait.

Create one using with_level or with_verbosity and then call init or try_init on it.

Implementations

impl Logger[src]

pub fn with_level(level: LevelFilter) -> Logger[src]

Create a Logger with the given level.

pub fn with_verbosity(level: usize) -> Logger[src]

Create a Logger with the given "verbosity" number. Useful for translating a number of -v flags in command-line arguments.

0 = Off, 1 = Error, 2 = Warn, 3 = Info, 4 = Debug, 5+ = Trace

pub fn color(&mut self, c: ColorMode) -> &mut Logger[src]

Sets the color mode, see ColorMode for details.

pub fn try_init(self) -> Result<(), SetLoggerError>[src]

Register this as the global logger with the log crate. May fail if the application has already set a logger.

pub fn init(self)[src]

Same as try_init but panic on failure.

Trait Implementations

impl Debug for Logger[src]

impl Log for Logger[src]

Auto Trait Implementations

impl RefUnwindSafe for Logger

impl Send for Logger

impl Sync for Logger

impl Unpin for Logger

impl UnwindSafe for Logger

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.