Giter Site home page Giter Site logo

loggen's Introduction

loggen: Generate logs from a directory tree of sample logs

loggen is a CLI tool that takes an input base directory, finds all files in it and reads each line of each file and writes it to the same path in an output base directory.

When it reaches the end of the file it starts again.

Stop with Ctrl+C

Options

loggen --help

loggen
Generate logs from a directory tree of sample logs

USAGE:
    loggen [OPTIONS] --in-base-dir <FILE> --out-base-dir <FILE> --wrap-strategy <STRATEGY>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -i, --in-base-dir <FILE>          Input base directory
    -t, --interval <MS>               Time in milliseconds between reads [default: 250]
    -o, --out-base-dir <FILE>         Output base directory
    -p, --parallelism <COUNT>         Number of parallel generators [default: 2]
    -w, --wrap-strategy <STRATEGY>    What to do when sample log reaches the end [default: append]  [possible values: truncate, append, rotate]

Example usage

There is a sample input directory in data, replace in-dir-path for data to try it with them.

You can watch the results written in out-dir-path with tail -F output-dir-path/*/*/*.log

Simple

Sleep 250ms between reads, use as many threads as available cores

loggen -i in-dir-path -o out-dir-path

Two threads, sleep 1ms between reads

Sleep 1ms between reads, use 2 threads

loggen -i in-dir-path -o out-dir-path -p 2 -t 1

Build

You need rust, check https://rustup.rs/ for installation instructions.

Run in development

cargo run -- -i in-dir-path -o out-dir-path

Release build

Binary is in target/release/loggen

cargo build --release

License

MIT

loggen's People

Contributors

marianoguerra avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.