Update TEST_MAPPING am: e59302f6e7 am: b9015dad6b

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/kernlog/+/2108549

Change-Id: I3947e22a0749833cd188404135a51f2f507a5911
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
tree: 37514ac081c95e9a59a4c6803bb28ff3a601d42c
  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.