Bug: 191700800

Clone this repo:
  1. 88722bc Update Android.bp by running cargo_embargo am: d1707cadaf by James Farrell · 8 weeks ago main master
  2. d1707ca Update Android.bp by running cargo_embargo by James Farrell · 9 weeks ago
  3. a1fcb0f Update Android.bp by running cargo_embargo am: aba8833ddd am: ff490bf93e by James Farrell · 5 months ago android15-tests-dev
  4. ff490bf Update Android.bp by running cargo_embargo am: aba8833ddd by James Farrell · 5 months ago
  5. aba8833 Update Android.bp by running cargo_embargo by James Farrell · 5 months ago

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.