Bug: 191700800

Clone this repo:
  1. 6c2a039 Migrate to cargo_embargo. am: 15111750e5 am: 2e96eb30c2 am: 6d5b778deb by Andrew Walbran · 6 months ago main master
  2. 537be0d Migrate to cargo_embargo. am: 15111750e5 am: 848584f455 am: 41bac43aef by Andrew Walbran · 6 months ago
  3. 6d5b778 Migrate to cargo_embargo. am: 15111750e5 am: 2e96eb30c2 by Andrew Walbran · 6 months ago
  4. 41bac43 Migrate to cargo_embargo. am: 15111750e5 am: 848584f455 by Andrew Walbran · 6 months ago
  5. 2e96eb3 Migrate to cargo_embargo. am: 15111750e5 by Andrew Walbran · 6 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.