Log

Struct Log 

Source
pub struct Log;
Expand description

A struct for Android logging

Implementations§

Source§

impl Log

Source

pub fn print(prio: LogPriority, tag: &str, msg: &str)

Print formatted log message

Source

pub fn write<T>(prio: LogPriority, tag: &str, msg: &str)

Write simple log message

Source

pub fn verbose<T>(tag: T, msg: T)
where T: AsRef<str>,

Log verbose message

§Arguments
  • tag - The tag of the log message
  • msg - The log message
Source

pub fn debug<T>(tag: T, msg: T)
where T: AsRef<str>,

Log debug message

§Arguments
  • tag - The tag of the log message
  • msg - The log message
Source

pub fn info<T>(tag: T, msg: T)
where T: AsRef<str>,

Log debug message

§Arguments
  • tag - The tag of the log message
  • msg - The log message
Source

pub fn warn<T>(tag: T, msg: T)
where T: AsRef<str>,

Log warn message

§Arguments
  • tag - The tag of the log message
  • msg - The log message
Source

pub fn error<T>(tag: T, msg: T)
where T: AsRef<str>,

Log error message

§Arguments
  • tag - The tag of the log message
  • msg - The log message
Source

pub fn v<T>(msg: T)
where T: AsRef<str>,

Log verbose message using the global tag If the global Log instance is not initialized, use the default tag [DEFAULT_TAG]

§Arguments
  • msg - The log message
Source

pub fn d<T>(msg: T)
where T: AsRef<str>,

Log debug message using the global tag If the global Log instance is not initialized, use the default tag [DEFAULT_TAG]

§Arguments
  • msg - The log message
Source

pub fn i<T>(msg: T)
where T: AsRef<str>,

Log info message using the global tag If the global Log instance is not initialized, use the default tag [DEFAULT_TAG]

§Arguments
  • msg - The log message
Source

pub fn w<T>(msg: T)
where T: AsRef<str>,

Log warn message using the global tag If the global Log instance is not initialized, use the default tag [DEFAULT_TAG]

§Arguments
  • msg - The log message
Source

pub fn e<T>(msg: T)
where T: AsRef<str>,

Log error message using the global tag If the global Log instance is not initialized, use the default tag [DEFAULT_TAG]

§Arguments
  • msg - The log message
Source

pub fn init(tag: &str, mixinlog: bool)

Initialize the global Log instance with a specific tag

§Arguments
  • tag - The tag to be used for the global Log instance
  • mixinlog - If true, set the Rust log crate to use this Log instance as the logger. e.g. log::info!(“message”)
Source

pub fn tag() -> &'static str

Get the tag of the Log instance

Source

pub fn enabled(enabled: bool)

Enable or disable logging

§Arguments
  • enabled - If true, enable logging; if false, disable logging
Source

pub fn is_enabled() -> bool

Check if logging is enabled

Trait Implementations§

Source§

impl Log for Log

Source§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
Source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
Source§

fn flush(&self)

Flushes any buffered records. Read more

Auto Trait Implementations§

§

impl Freeze for Log

§

impl RefUnwindSafe for Log

§

impl Send for Log

§

impl Sync for Log

§

impl Unpin for Log

§

impl UnwindSafe for Log

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.