Crates.io | ndk-logger |
lib.rs | ndk-logger |
version | 0.0.2 |
source | src |
created_at | 2018-01-18 02:59:07.798744 |
updated_at | 2018-01-25 10:31:28.930068 |
description | A library bridging [log](https://crates.io/crates/log) message to [Android NDK log](https://developer.android.com/ndk/reference/log_8h.html). |
homepage | https://github.com/jarod/ndk-logger |
repository | https://github.com/jarod/ndk-logger |
max_upload_size | |
id | 47253 |
size | 3,989 |
A library bridging log message to Android NDK log.
Cargo.toml
[target.'cfg(target_os="android")'.dependencies]
ndk-logger = "*"
Rust entry
#[macro_use]
extern crate log;
#[cfg(target_os="android")]
extern crate ndk_logger;
#[cfg(target_os="android")]
fn init_logger() {
ndk_logger::init().unwrap();
}
#[cfg(not(target_os="android"))]
fn init_logger() {
// init logger for other platform
}
fn main() {
init_logger();
}