Struct spdlog::sink::StdStreamSink
source · pub struct StdStreamSink { /* private fields */ }
Expand description
A sink with a std stream as the target.
It writes styled text or plain text according to the given StyleMode
.
Note that this sink always flushes the buffer once with each logging.
Implementations§
source§impl StdStreamSink
impl StdStreamSink
sourcepub fn builder() -> StdStreamSinkBuilder<()>
pub fn builder() -> StdStreamSinkBuilder<()>
Constructs a builder of StdStreamSink
.
sourcepub fn new(std_stream: StdStream, style_mode: StyleMode) -> StdStreamSink
👎Deprecated since 0.3.0: it may be removed in the future, use StdStreamSink::builder()
instead
pub fn new(std_stream: StdStream, style_mode: StyleMode) -> StdStreamSink
StdStreamSink::builder()
insteadConstructs a StdStreamSink
.
sourcepub fn set_style(&mut self, level: Level, style: Style)
pub fn set_style(&mut self, level: Level, style: Style)
Sets the style of the specified log level.
sourcepub fn set_style_mode(&mut self, style_mode: StyleMode)
pub fn set_style_mode(&mut self, style_mode: StyleMode)
Sets the style mode.
Trait Implementations§
source§impl Sink for StdStreamSink
impl Sink for StdStreamSink
source§fn level_filter(&self) -> LevelFilter
fn level_filter(&self) -> LevelFilter
Gets the log level filter.
source§fn set_level_filter(&self, level_filter: LevelFilter)
fn set_level_filter(&self, level_filter: LevelFilter)
Sets the log level filter.
source§fn set_formatter(&self, formatter: Box<dyn Formatter>)
fn set_formatter(&self, formatter: Box<dyn Formatter>)
Sets the formatter.
source§fn set_error_handler(&self, handler: Option<ErrorHandler>)
fn set_error_handler(&self, handler: Option<ErrorHandler>)
Sets a error handler. Read more
source§fn should_log(&self, level: Level) -> bool
fn should_log(&self, level: Level) -> bool
Determines if a log message with the specified level would be logged.
Auto Trait Implementations§
impl !RefUnwindSafe for StdStreamSink
impl Send for StdStreamSink
impl Sync for StdStreamSink
impl Unpin for StdStreamSink
impl !UnwindSafe for StdStreamSink
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