21 stable releases

1.1.19 Nov 13, 2023
1.1.16 Jun 29, 2023
1.1.14 Mar 18, 2022
1.1.13 Apr 22, 2021
1.1.5 Sep 13, 2018

#284 in Debugging

Download history 17/week @ 2024-09-20 4/week @ 2024-09-27

57 downloads per month

MIT license

8KB
86 lines

Pipe Logger

CI

Stores, rotates, compresses process logs.

Help

EXAMPLES:
pipe-logger /path/to/out.log                          # Store log into /path/to/out.log
pipe-logger /path/to/out.log -r 10M                   # The same as above, plus if its size is over than 10MB, it will be rotated and renamed
pipe-logger /path/to/out.log -r 10M -c 4              # The same as above, plus the max count of log files is 4. The oldest ones will be removed when the quota is exhausted
pipe-logger /path/to/out.log -r 10M -c 4 --compress   # The same as above, plus the rotated log files are compressed by xz

Usage: pipe-logger [OPTIONS]

Options:
  -r, --rotate <ROTATE>      Rotate the log file
  -c, --count <COUNT>        Assign the max count of log files
      --compress             Compress the rotated log files
      --err                  Re-output logs through stderr
      --log-path <LOG_PATH>  The path that you want to store your logs [default: logfile.log]
  -h, --help                 Print help
  -V, --version              Print version

Examples

lovable_process | pipe-logger -r 10m -c 5 --compress mylog.txt
lovable_process > >(pipe-logger mylog.txt) 2> >(pipe-logger --err error-mylog.txt)

License

MIT

Dependencies

~8–19MB
~281K SLoC