pub fn init<S: Into<String>>(tag: S) -> Result<(), SetLoggerError>
Initializes the global logger with an AndroidLogger
AndroidLogger
This should be called early in the execution of a Rust program and the global logger may only be initialized once. Future attempts will return an error.
5fn main() { 6 android_log::init("MyApp").unwrap(); 7 8 trace!("Initialized Rust"); 9 debug!("Address is {:p}", main as *const ()); 10 info!("Did you know? {} = {}", "1 + 1", 2); 11 warn!("Don't log sensitive information!"); 12 error!("Nothing more to say"); 13}