Skip to main content

EspIdfLogger

Struct EspIdfLogger 

Source
pub struct EspIdfLogger<T = ()> { /* private fields */ }
Expand description

A logger that integrates with the ESP-IDF logging system.

Specifically:

  • It logs to stdout/stderr just like the ESP-IDF native C logging functions
  • The format of the logs matches the ESP-IDF native C logging format
  • If the EspIdfLogFilter backend is used, it respects the ESP-IDF log level configuration

Implementations§

Source§

impl EspIdfLogger<EspIdfLogFilter>

Source

pub fn initialize_default()

For backwards compatibility

Equivalent to calling init_from_esp_idf()

Source§

impl<T> EspIdfLogger<T>

Source

pub const fn new(filter: T) -> Self

Create a new instance of EspIdfLogger with the specified log filter backend.

§Arguments
  • filter: The log filter backend to use for filtering log messages.
Source

pub fn filter(&self) -> &T

Return a reference to the log filter backend used by this logger.

Trait Implementations§

Source§

impl<T: Debug> Debug for EspIdfLogger<T>

Source§

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

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

impl<T> Log for EspIdfLogger<T>
where T: LogFilterBackend + Send + Sync,

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§

§

impl<T> Freeze for EspIdfLogger<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for EspIdfLogger<T>
where T: RefUnwindSafe,

§

impl<T> Send for EspIdfLogger<T>
where T: Send,

§

impl<T> Sync for EspIdfLogger<T>
where T: Sync,

§

impl<T> Unpin for EspIdfLogger<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for EspIdfLogger<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for EspIdfLogger<T>
where T: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.