Platform Tools Release 31.0.3 (7562133)
Snap for 7529902 from 18acd4fc9e7ee4171353b297103c6f9ffe273b42 to sdk-release

Change-Id: Ie126d2cb6a929738fa19c76955fe3a5f5c43d3b6
tree: 1dc779d324299f08c5e69538ee554a1cf784f867
  1. patches/
  2. src/
  3. Android.bp
  4. Cargo.toml
  5. LICENSE
  6. METADATA
  7. MODULE_LICENSE_MIT
  8. OWNERS
  9. README.md
README.md

Kernel logger for Rust

Logger implementation for low level kernel log (using /dev/kmsg)

Usually intended for low level implementations, like systemd generators, which have to use /dev/kmsg:

Since syslog is not available (see above) write log messages to /dev/kmsg instead.

Full documentation.

Usage

[dependencies]
log = "0.4"
kernlog = "0.3"
#[macro_use]
extern crate log;
extern crate kernlog;

fn main() {
    kernlog::init().unwrap();
    warn!("something strange happened");
}

Note you have to have permissions to write to /dev/kmsg, which normal users (not root) usually don't.