[−][src]Struct log_rs::Logger
A logger that can log messages on different level to different output.
The output of each level can be configured to eventually be same for all, or unique.
Methods
impl<'o> Logger<'o>
[src]
pub fn new() -> Option<Self>
[src]
Create a new logger.
By default, INFO
and DEBUG
are writting to stdout
,
and WARNING
and ERROR
write to stderr
.
Return Value
The new logger if the function succeeded, None
otherwise.
pub fn config_format<S: ToString + ?Sized>(&mut self, new_format: &S)
[src]
Configure the format of the log.
Arguments
new_format
- The format to be used for logging message.
Any occurrence of%l
will be replaced by the level,%t
by the timestamp,%m
by the message.
pub fn config_info(&mut self, kind: OutputKind<'o>)
[src]
pub fn config_debug(&mut self, kind: OutputKind<'o>)
[src]
pub fn config_warning(&mut self, kind: OutputKind<'o>)
[src]
pub fn config_error(&mut self, kind: OutputKind<'o>)
[src]
pub fn info(&mut self, msg: &str)
[src]
pub fn debug(&mut self, msg: &str)
[src]
pub fn warning(&mut self, msg: &str)
[src]
pub fn error(&mut self, msg: &str)
[src]
Auto Trait Implementations
impl<'o> !RefUnwindSafe for Logger<'o>
impl<'o> !Send for Logger<'o>
impl<'o> !Sync for Logger<'o>
impl<'o> Unpin for Logger<'o>
impl<'o> !UnwindSafe for Logger<'o>
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,
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.
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>,