pub struct Logger { /* private fields */ }
Expand description

Logger configuration handle. Logger configuration handler stores access to logger configuration parameters.

Implementations§

source§

impl Logger

source

pub fn buffer(&self, buffer: Buffer) -> &Self

Sets buffer parameter of logger configuration

§Examples

let logger = android_logd_logger::builder().init();

logger.buffer(Buffer::Crash);
source

pub fn tag(&self, tag: &str) -> &Self

§Examples

let logger = android_logd_logger::builder().init();

logger.tag("foo");
source

pub fn tag_target(&self) -> &Self

Sets tag parameter of logger configuration to target value

§Examples

let logger = android_logd_logger::builder().init();

logger.tag_target();
source

pub fn tag_target_strip(&self) -> &Self

Sets tag parameter of logger configuration to strip value

§Examples

let logger = android_logd_logger::builder().init();

logger.tag_target_strip();
source

pub fn prepend_module(&self, prepend_module: bool) -> &Self

Sets prepend module parameter of logger configuration

§Examples

let logger = android_logd_logger::builder().init();

logger.prepend_module(true);
source

pub fn filter_module(&self, module: &str, level: LevelFilter) -> &Self

Adds a directive to the filter for a specific module.

§Examples

Only include messages for warning and above for logs in path::to::module:


let logger = android_logd_logger::builder().init();

logger.filter_module("path::to::module", LevelFilter::Info);
source

pub fn filter_level(&self, level: LevelFilter) -> &Self

Adjust filter.

§Examples

Only include messages for warning and above.


let logger = Builder::new().init();
logger.filter_level(LevelFilter::Info);
source

pub fn filter(&self, module: Option<&str>, level: LevelFilter) -> &Self

Adjust filter.

The given module (if any) will log at most the specified level provided. If no module is provided then the filter will apply to all log messages.

§Examples

Only include messages for warning and above for logs in path::to::module:


let logger = Builder::new().init();
logger.filter(Some("path::to::module"), LevelFilter::Info);
source

pub fn parse_filters(&mut self, filters: &str) -> &mut Self

Parses the directives string in the same form as the RUST_LOG environment variable.

See the module documentation for more details.

Trait Implementations§

source§

impl Clone for Logger

source§

fn clone(&self) -> Logger

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Logger

§

impl Send for Logger

§

impl Sync for Logger

§

impl Unpin for Logger

§

impl !UnwindSafe for Logger

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.