#android #write #logging #subsystem

android_log

Logger which writes to Android logging subsystem

3 releases

Uses old Rust 2015

0.1.3 Feb 27, 2017
0.1.2 Feb 23, 2017
0.1.1 Nov 15, 2016

#53 in #subsystem

Download history 40/week @ 2024-03-11 21/week @ 2024-03-18 52/week @ 2024-03-25 56/week @ 2024-04-01 19/week @ 2024-04-08 26/week @ 2024-04-15 24/week @ 2024-04-22 28/week @ 2024-04-29 24/week @ 2024-05-06 23/week @ 2024-05-13 32/week @ 2024-05-20 28/week @ 2024-05-27 23/week @ 2024-06-03 26/week @ 2024-06-10 24/week @ 2024-06-17 22/week @ 2024-06-24

99 downloads per month
Used in mediacodec

MIT/Apache

7KB
73 lines

android_log

crates.io Travis CI

Logger which writes to Android logging subsystem.

License

android_log is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.


lib.rs:

A logger which writes to the Android logging subsystem. It must be compiled with the Android NDK in order to link to liblog.

Example

#[macro_use] extern crate log;
extern crate android_log;

fn main() {
    android_log::init("MyApp").unwrap();

    trace!("Initialized Rust");
    debug!("Address is {:p}", main as *const ());
    info!("Did you know? {} = {}", "1 + 1", 2);
    warn!("Don't log sensitive information!");
    error!("Nothing more to say");
}
$ logcat
12-25 12:00:00.000  1234  1234 V MyApp: Initialized Rust
12-25 12:00:00.000  1234  1234 D MyApp: Address is 0xdeadbeef
12-25 12:00:00.000  1234  1234 I MyApp: Did you know? 1 + 1 = 2
12-25 12:00:00.000  1234  1234 W MyApp: Don't log sensitive information!
12-25 12:00:00.000  1234  1234 E MyApp: Nothing more to say

Dependencies

~210KB