Crates.io | kernlog |
lib.rs | kernlog |
version | 0.3.1 |
source | src |
created_at | 2015-07-04 16:07:47.9134 |
updated_at | 2020-09-06 17:02:06.791778 |
description | Kernel logger implementation (for low level logging to `/dev/kmsg`). |
homepage | |
repository | https://github.com/kstep/kernlog.rs.git |
max_upload_size | |
id | 2529 |
size | 6,849 |
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.
[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.