Snap for 8743232 from 8aea471660ec8232a134779e88ba884f5ab63219 to gki13-boot-release

Change-Id: Id044cfaf2f6779ae677ff48a86289ee84c914d37
tree: fd087aeaa9471b3c5ed13408f8cdeda713b1886b
  1. patches/
  2. src/
  3. Android.bp
  4. Cargo.toml
  5. cargo2android.json
  6. LICENSE
  7. METADATA
  8. MODULE_LICENSE_MIT
  9. OWNERS
  10. README.md
  11. TEST_MAPPING
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.