pub struct LogPrefs { /* private fields */ }Expand description
Preferences that dictate logging.
Implementations§
Source§impl LogPrefs
impl LogPrefs
Sourcepub fn quiet(&mut self, quiet: bool) -> &mut Self
pub fn quiet(&mut self, quiet: bool) -> &mut Self
Sets whether all output should be silenced, regardless of log level.
§Example
bunt_logger::with().quiet(true);Sourcepub fn writer(&mut self, writer: Box<dyn WriteColor + Send + Sync>) -> &mut Self
pub fn writer(&mut self, writer: Box<dyn WriteColor + Send + Sync>) -> &mut Self
Sets the logging target.
By default, StandardStream::stdout(ColorChoice::Auto) is used.
§Example
use bunt_logger::{ColorChoice, StandardStream};
let stderr_writer = StandardStream::stderr(ColorChoice::Never);
bunt_logger::with()
.writer(Box::new(stderr_writer));Sourcepub fn stdout(&mut self, color: ColorChoice) -> &mut Self
pub fn stdout(&mut self, color: ColorChoice) -> &mut Self
Sets the logging target to stdout with the given ColorChoice.
§Example
use bunt_logger::ColorChoice;
bunt_logger::with()
.stdout(ColorChoice::Always);Sourcepub fn stderr(&mut self, color: ColorChoice) -> &mut Self
pub fn stderr(&mut self, color: ColorChoice) -> &mut Self
Sets the logging target to stderr with the given ColorChoice.
§Example
use bunt_logger::ColorChoice;
bunt_logger::with()
.stderr(ColorChoice::Always);Auto Trait Implementations§
impl Freeze for LogPrefs
impl !RefUnwindSafe for LogPrefs
impl Send for LogPrefs
impl !Sync for LogPrefs
impl Unpin for LogPrefs
impl !UnwindSafe for LogPrefs
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