[−][src]Struct yall::Logger
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
Auto Trait Implementations
impl RefUnwindSafe for Logger
[src]
impl Send for Logger
[src]
impl Sync for Logger
[src]
impl Unpin for Logger
[src]
impl UnwindSafe for Logger
[src]
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,
pub 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, 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.
pub 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>,