liiir1985 7f62dcda9f | ||
---|---|---|
.. | ||
patches | ||
src | ||
Android.bp | ||
Cargo.toml | ||
LICENSE | ||
METADATA | ||
MODULE_LICENSE_MIT | ||
OWNERS | ||
README.md | ||
TEST_MAPPING | ||
cargo2android.json |
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.
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.