[go: up one dir, main page]

Function init

Source
pub fn init<S: Into<String>>(tag: S) -> Result<(), SetLoggerError>
Expand description

Initializes the global logger with an 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.

Examples found in repository?
examples/simple.rs (line 6)
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}