Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lloydmeta/chase-rs
Async + Sync file-following for people who care about file rotations and line numbers.
https://github.com/lloydmeta/chase-rs
async channels cli file-following files logging logs rust streams tail
Last synced: 4 months ago
JSON representation
Async + Sync file-following for people who care about file rotations and line numbers.
- Host: GitHub
- URL: https://github.com/lloydmeta/chase-rs
- Owner: lloydmeta
- License: mit
- Created: 2018-02-19T02:21:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-21T08:01:34.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T09:43:58.016Z (4 months ago)
- Topics: async, channels, cli, file-following, files, logging, logs, rust, streams, tail
- Language: Rust
- Homepage:
- Size: 43 KB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chase [![Build Status](https://travis-ci.org/lloydmeta/chase-rs.svg?branch=master)](https://travis-ci.org/lloydmeta/chase-rs) [![Crates.io](https://img.shields.io/crates/v/chase.svg)](https://crates.io/crates/chase) [![Chase](https://docs.rs/chase/badge.svg)](https://docs.rs/chase)
An implementation of async and sync file-following in Rust for people who care about line numbers.
### Goals
- Provide line numbers with each line yielded
- Ability to exit the watch loop programmatically
- Deals with file rotations automatically
- Cross-platform async
- Configurable (which line to start on, delays and retries)
- Easy to use synchronously
- Easy to use asynchronously
- Can receive data from a standard lib a [Channel](https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html)
- Can receive data from a `Stream` from the [Futures library](https://github.com/alexcrichton/futures-rs)
### UsageYou can use this tool as a lib and as a binary:
#### As lib
Some features (e.g. receiving as a `Stream`, and Serde derive for lib-provided structs) are feature-gated, so
keep that in mind when adding as a dependency (refer to `Cargo.toml` for list of features)#### As a binary
`cargo install chase --features=binary`
```shell
Chases a file through thick and thin.USAGE:
chase [OPTIONS]FLAGS:
-h, --help Prints help information
-V, --version Prints version informationOPTIONS:
-L, --line The line you want to start chasing your file from [default: 0]ARGS:
The file you want to chase
```
### CaveatsWindows not yet supported: need to figure out what inodes map to
### Credit
Very much inspired by [logwatcher](https://github.com/aravindavk/logwatcher/)