• Home
Name
Date
Size
#Lines
LOC

..--

patches/03-May-2024-6657

src/03-May-2024-194118

Android.bpD03-May-2024983 4137

Cargo.tomlD03-May-2024482 1614

LICENSED03-May-20241.1 KiB2217

METADATAD03-May-2024345 1816

MODULE_LICENSE_MITD03-May-20240

OWNERSD03-May-202440 21

README.mdD03-May-2024756 3625

TEST_MAPPINGD03-May-2024177 98

cargo2android.jsonD03-May-202435 44

README.md

1# Kernel logger for Rust
2
3Logger implementation for low level kernel log (using `/dev/kmsg`)
4
5Usually intended for low level implementations, like [systemd generators][1],
6which have to use `/dev/kmsg`:
7
8> Since syslog is not available (see above) write log messages to /dev/kmsg instead.
9
10[Full documentation.][2]
11
12[1]: http://www.freedesktop.org/wiki/Software/systemd/Generators/
13[2]: http://kstep.me/kernlog.rs/kernlog/index.html
14
15## Usage
16
17```toml
18[dependencies]
19log = "0.4"
20kernlog = "0.3"
21```
22
23```rust
24#[macro_use]
25extern crate log;
26extern crate kernlog;
27
28fn main() {
29    kernlog::init().unwrap();
30    warn!("something strange happened");
31}
32```
33
34Note you have to have permissions to write to `/dev/kmsg`,
35which normal users (not root) usually don't.
36