logwatcher 0.1.1

A lib to watch log files for new Changes, just like tail -f
Documentation
  • Coverage
  • 0%
    0 out of 7 items documented0 out of 4 items with examples
  • Size
  • Source code size: 6.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 940.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • aravindavk/logwatcher
    31 19 5
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • aravindavk

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
});