Struct Settings

Source
pub struct Settings {
    pub title: &'static str,
    pub filters: &'static [(&'static str, LevelFilter)],
    pub file_out: Option<&'static Path>,
    pub console_out: bool,
    pub panic_hook: bool,
}
Expand description

Settings for the logger

Fields§

§title: &'static str

A human-readable name for the application

§filters: &'static [(&'static str, LevelFilter)]

List of module-prefix filters to match against, earlier filters get priority

§file_out: Option<&'static Path>

Optional file path to output to (desktop only)

§console_out: bool

Set to true to output to an appropriate console

§panic_hook: bool

Set to true to enable the panic hook

Implementations§

Source§

impl Settings

Source

pub fn init(self)

Initializes the logger

§Panics

will panic if initialization fails in any way

Examples found in repository?
examples/demo.rs (line 16)
8fn main() {
9	multiline_logger::Settings {
10		title: "logger test",
11		filters: &[("", LevelFilter::Trace)],
12		file_out: Some(Path::new("target/test.log")),
13		console_out: true,
14		panic_hook: true,
15	}
16	.init();
17	log::trace!("Trace\n");
18	log::debug!("Debug\n{:?}", [1, 2, 3, 4]);
19	log::info!("Info: {}", 7);
20	log::warn!("Warn {:#?}", [0, 9, 8, 7]);
21	log::error!("Error");
22	panic!("Panic Message");
23}

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.