Struct BaseHandler

Source
pub struct BaseHandler { /* private fields */ }
Expand description

Base handler implementation

Implementations§

Source§

impl BaseHandler

Source

pub fn new(level: LogLevel) -> Self

Create a new handler

Trait Implementations§

Source§

impl Debug for BaseHandler

Source§

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

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

impl Handler for BaseHandler

Source§

fn level(&self) -> LogLevel

Get the log level
Source§

fn set_level(&mut self, level: LogLevel)

Set the log level
Source§

fn is_enabled(&self) -> bool

Check if the handler is enabled
Source§

fn set_enabled(&mut self, enabled: bool)

Set whether the handler is enabled
Source§

fn formatter(&self) -> &Formatter

Get the formatter
Source§

fn set_formatter(&mut self, formatter: Formatter)

Set the formatter
Source§

fn set_filter(&mut self, filter: Option<HandlerFilter>)

Set a filter closure for this handler (optional, default: no filter)
Source§

fn filter(&self) -> Option<&HandlerFilter>

Get the filter closure for this handler (optional)
Source§

fn handle(&self, record: &Record) -> Result<(), HandlerError>

Handle a log record
Source§

fn handle_batch(&self, records: &[Record]) -> Result<(), HandlerError>

Handle a batch of log records (optimized implementation)
Source§

fn init(&mut self) -> Result<(), HandlerError>

Lifecycle: initialize the handler
Source§

fn flush(&self) -> Result<(), HandlerError>

Lifecycle: flush the handler
Source§

fn shutdown(&mut self) -> Result<(), HandlerError>

Lifecycle: shutdown the handler

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.