tree: 451e002c1776f03ec4659e9f461e7ced7d5b1fff [path history] [tgz]
  1. patches/
  2. src/
  3. .android-checksum.json
  4. .cargo-checksum.json
  5. Android.bp
  6. Cargo.toml
  7. cargo_embargo.json
  8. LICENSE
  9. METADATA
  10. MODULE_LICENSE_MIT
  11. README.md
  12. TEST_MAPPING
crates/kernlog/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.