Struct ELogger

Source
pub struct ELogger { /* private fields */ }

Implementations§

Source§

impl ELogger

you should have done all of initialization setup before calling init();

Source

pub fn new() -> Self

Source

pub fn new_dest(dest: &str) -> Self

Source

pub fn set_max_level(self, l: Level) -> Self

set the max Level, you can also use log::set_max_level but you can only get the max filter level by call log::max_level you can only input [“ERROR”, “WARN”, “INFO”, “DEBUG”, “TRACE”] case maybe I can cover more one layer upon the log::log! ? it’s only the old impl, at that time, I want to implement a completely isolation.

Source

pub fn set_time_format(self, format: &str) -> Self

use your custom format to log the time you can link to time crate https://crates.io/crates/time getting the introduction of time format

Source

pub fn get_time(&self) -> String

get the formatted time

Source

pub fn set_use_local(self, is_use: bool) -> Self

a switch for controlling your log time standard

Source

pub fn set_log_time(self, is_open: bool) -> Self

control whether log the time

Source

pub fn enable_use_color(self) -> Self

enabled to use color format

Source

pub fn disable_use_color(self) -> Self

disable to use color format

Source

pub fn is_use_color(&self) -> bool

check use_color

Source

pub fn get_color(&self, l: Level) -> (Color, Color)

get (Color, Color)

Source

pub fn is_use_dest(&self) -> bool

destination

Source

pub fn push_output(&self, stream: &str)

push stream into

Source

pub fn set_use_dest(self, is_open: bool) -> Self

control whether use the

Source

pub fn init(self) -> Result<(), SetLoggerError>

Trait Implementations§

Source§

impl Debug for ELogger

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Log for ELogger

Source§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
Source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
Source§

fn flush(&self)

Flushes any buffered records. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.