A Rust library to watch the log files.
Note: Tested only in Linux
First, add the following to your Cargo.toml
toml
[dependencies]
logwatcher = "0.1"
Add to your code,
rust
extern crate logwatcher;
use logwatcher::LogWatcher;
Register the logwatcher, pass a closure and watch it!
```rust let mut logwatcher = LogWatcher::register("/var/log/check.log".tostring()).unwrap();
log_watcher.watch(&mut move |line: String| { println!("Line {}", line); LogWatcherAction::None }); ```