Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
patches/ | 25-Apr-2025 | - | 94 | 84 | ||
src/ | 25-Apr-2025 | - | 194 | 118 | ||
.cargo-checksum.json | D | 25-Apr-2025 | 327 | 1 | 1 | |
Android.bp | D | 25-Apr-2025 | 870 | 35 | 31 | |
Cargo.toml | D | 25-Apr-2025 | 1,023 | 30 | 27 | |
LICENSE | D | 25-Apr-2025 | 1.1 KiB | 22 | 17 | |
METADATA | D | 25-Apr-2025 | 381 | 18 | 17 | |
MODULE_LICENSE_MIT | D | 25-Apr-2025 | 0 | |||
README.md | D | 25-Apr-2025 | 756 | 36 | 25 | |
TEST_MAPPING | D | 25-Apr-2025 | 177 | 9 | 8 | |
cargo_embargo.json | D | 25-Apr-2025 | 25 | 4 | 3 |
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