pub struct NetworkHandler { /* private fields */ }
Expand description
A handler that writes log records to a network socket
Implementations§
Source§impl NetworkHandler
impl NetworkHandler
pub fn new(stream: TcpStream, level: LogLevel) -> Self
pub fn with_level(self, level: LogLevel) -> Self
pub fn with_formatter(self, formatter: Formatter) -> Self
pub fn with_colors(self, use_colors: bool) -> Self
pub fn with_pattern(self, pattern: impl Into<String>) -> Self
pub fn with_format<F>(self, format_fn: F) -> Self
pub fn with_filter(self, filter: HandlerFilter) -> Self
pub fn with_batching(self, batch_size: usize) -> Self
Trait Implementations§
Source§impl Clone for NetworkHandler
impl Clone for NetworkHandler
Source§impl Debug for NetworkHandler
impl Debug for NetworkHandler
Source§impl Handler for NetworkHandler
impl Handler for NetworkHandler
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Check if the handler is enabled
Source§fn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Set whether the handler is enabled
Source§fn set_formatter(&mut self, formatter: Formatter)
fn set_formatter(&mut self, formatter: Formatter)
Set the formatter
Source§fn set_filter(&mut self, filter: Option<HandlerFilter>)
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>
fn filter(&self) -> Option<&HandlerFilter>
Get the filter closure for this handler (optional)
Source§fn handle_batch(&self, records: &[Record]) -> Result<(), HandlerError>
fn handle_batch(&self, records: &[Record]) -> Result<(), HandlerError>
Handle a batch of log records (optimized implementation)
Auto Trait Implementations§
impl Freeze for NetworkHandler
impl !RefUnwindSafe for NetworkHandler
impl Send for NetworkHandler
impl Sync for NetworkHandler
impl Unpin for NetworkHandler
impl !UnwindSafe for NetworkHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more