pub struct StringLogSink { /* private fields */ }Expand description
A sink that formats events as text lines and hands them to a callback.
Implementations§
Source§impl StringLogSink
impl StringLogSink
Sourcepub fn new(
logger: impl Fn(&str) + Send + Sync + 'static,
minimum_level: LogEventLevel,
areas: &[&str],
) -> Self
pub fn new( logger: impl Fn(&str) + Send + Sync + 'static, minimum_level: LogEventLevel, areas: &[&str], ) -> Self
Creates a sink that passes every formatted event with at least
minimum_level to logger. When areas is not empty only events of
those areas are logged; valid values are listed in
LogArea.
Sourcepub fn trace(minimum_level: LogEventLevel, areas: &[&str]) -> Self
pub fn trace(minimum_level: LogEventLevel, areas: &[&str]) -> Self
Creates a sink that writes events to the diagnostic trace output of the process (standard error).
Trait Implementations§
Source§impl ILogSink for StringLogSink
impl ILogSink for StringLogSink
Source§fn is_enabled(&self, level: LogEventLevel, area: &str) -> bool
fn is_enabled(&self, level: LogEventLevel, area: &str) -> bool
Checks if given log level and area is enabled.
Source§fn log(
&self,
level: LogEventLevel,
area: &str,
source: Option<&dyn Any>,
message_template: &str,
)
fn log( &self, level: LogEventLevel, area: &str, source: Option<&dyn Any>, message_template: &str, )
Logs an event. Read more
Source§fn log_with_values(
&self,
level: LogEventLevel,
area: &str,
source: Option<&dyn Any>,
message_template: &str,
property_values: &[&dyn Display],
)
fn log_with_values( &self, level: LogEventLevel, area: &str, source: Option<&dyn Any>, message_template: &str, property_values: &[&dyn Display], )
Logs a new event. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StringLogSink
impl !UnwindSafe for StringLogSink
impl Freeze for StringLogSink
impl Send for StringLogSink
impl Sync for StringLogSink
impl Unpin for StringLogSink
impl UnsafeUnpin for StringLogSink
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more