Crates.io | logwatcher |
lib.rs | logwatcher |
version | 0.1.1 |
source | src |
created_at | 2016-01-04 10:56:22.022475 |
updated_at | 2020-08-21 07:18:27.285058 |
description | A lib to watch log files for new Changes, just like tail -f |
homepage | https://github.com/aravindavk/logwatcher |
repository | https://github.com/aravindavk/logwatcher |
max_upload_size | |
id | 3824 |
size | 6,940 |
A Rust library to watch the log files.
Note: Tested only in Linux
First, add the following to your Cargo.toml
[dependencies]
logwatcher = "0.1"
Add to your code,
extern crate logwatcher;
use logwatcher::LogWatcher;
Register the logwatcher, pass a closure and watch it!
let mut log_watcher = LogWatcher::register("/var/log/check.log".to_string()).unwrap();
log_watcher.watch(&mut move |line: String| {
println!("Line {}", line);
LogWatcherAction::None
});