[][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 new() -> Logger[src]

Create a Logger with the default Info level

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

Create a Logger with the given level.

pub fn with_verbosity(level: u64) -> 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 verbose(self, change: u64) -> Logger[src]

Increase the verbosity level by the amount given. Takes a u64 as returned by clap's ArgMatches::occurrences_of method.

pub fn quiet(self, change: u64) -> Logger[src]

Decrease the verbosity level by the amount given. Takes a u64 as returned by clap's ArgMatches::occurrences_of method.

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

Sets the color mode, see ColorMode for details.

pub fn full_filename(self, full: bool) -> Logger[src]

By default, yall will shorten the filename displayed in Debug and Trace logs by removing a "src/" prefix and ".rs" suffix, if present. Use this function to disable that and print the full unchanged filename.

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 Default for Logger[src]

pub fn default() -> Self[src]

Create a Logger with the default Info level

impl Log for Logger[src]

Auto Trait Implementations

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.