pub struct ConsoleHandler { /* private fields */ }Expand description
Publishes log entries to the console.
If console_type is:
ConsoleType::StdOut- print tostdout,ConsoleType::StdErr- print tostderr,ConsoleType::Production:
Iflog_entry.levelisLeveL::INFO, then
prints unformattedlog_entry.msgtostdout, else
prints formattedlog_entry.msgtostderr.
Trait Implementations§
Source§impl Debug for ConsoleHandler
impl Debug for ConsoleHandler
Source§impl Default for ConsoleHandler
impl Default for ConsoleHandler
Source§fn default() -> ConsoleHandler
fn default() -> ConsoleHandler
Returns the “default value” for a type. Read more
Source§impl Display for ConsoleHandler
impl Display for ConsoleHandler
Source§impl HandlerTrait for ConsoleHandler
impl HandlerTrait for ConsoleHandler
Source§fn close(&mut self)
fn close(&mut self)
Removes the internal buffer, if in test_mode.
Will therefore, no longer be in test_mode.
Source§fn set_test_mode(&mut self, state: bool)
fn set_test_mode(&mut self, state: bool)
Sets the test mode to state.
If set to true, use get_log() to obtain the
log.
Source§fn create(console_type: &str) -> Result<Self, Error>where
Self: Sized,
fn create(console_type: &str) -> Result<Self, Error>where
Self: Sized,
Create a new handler instance. Read more
Source§fn get_formatter(&self) -> Formatter
fn get_formatter(&self) -> Formatter
Return the Formatter for this Handler.
Source§fn set_formatter(&mut self, formatter: Formatter)
fn set_formatter(&mut self, formatter: Formatter)
Set a Formatter. Read more
Auto Trait Implementations§
impl Freeze for ConsoleHandler
impl !RefUnwindSafe for ConsoleHandler
impl Send for ConsoleHandler
impl Sync for ConsoleHandler
impl Unpin for ConsoleHandler
impl UnsafeUnpin for ConsoleHandler
impl !UnwindSafe for ConsoleHandler
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