Skip to content

aravindavk/logwatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Log Watcher Library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages