Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
patches/ | 03-May-2024 | - | 66 | 57 | ||
src/ | 03-May-2024 | - | 194 | 118 | ||
Android.bp | D | 03-May-2024 | 983 | 41 | 37 | |
Cargo.toml | D | 03-May-2024 | 482 | 16 | 14 | |
LICENSE | D | 03-May-2024 | 1.1 KiB | 22 | 17 | |
METADATA | D | 03-May-2024 | 345 | 18 | 16 | |
MODULE_LICENSE_MIT | D | 03-May-2024 | 0 | |||
OWNERS | D | 03-May-2024 | 40 | 2 | 1 | |
README.md | D | 03-May-2024 | 756 | 36 | 25 | |
TEST_MAPPING | D | 03-May-2024 | 177 | 9 | 8 | |
cargo2android.json | D | 03-May-2024 | 35 | 4 | 4 |
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