No description
Find a file
2016-11-13 11:52:37 +05:30
src Use closures 2016-11-04 02:24:17 +01:00
.gitignore First working commit 2016-01-04 16:21:41 +05:30
.travis.yml Added .travis.yml file and Build status 2016-01-04 16:35:44 +05:30
Cargo.toml First working commit 2016-01-04 16:21:41 +05:30
README.md Use closures 2016-11-04 02:24:17 +01:00

Log Watcher

Build Status

A Rust library to watch the log files.

Note: Tested only in Linux

Features:

  1. Automatically reloads log file when log rotated
  2. Calls callback function when new line to parse

Usage

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(&|line: String| {
    println!("Line {}", line);
});